Mercurial > hg > nginx-quic
comparison src/http/ngx_http_parse.c @ 575:fcd6fc7ff7f9 release-0.3.9
nginx-0.3.9-RELEASE import
*) Bugfix: nginx considered URI as unsafe if two any symbols was
between two slashes; the bug had appeared in 0.3.8.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 10 Nov 2005 07:44:53 +0000 |
parents | 58475592100c |
children | 4d9ea73a627a |
comparison
equal
deleted
inserted
replaced
574:206160abe62e | 575:fcd6fc7ff7f9 |
---|---|
1054 | 1054 |
1055 if (len > 2) { | 1055 if (len > 2) { |
1056 | 1056 |
1057 /* detect "/../" */ | 1057 /* detect "/../" */ |
1058 | 1058 |
1059 if (p[2] == '/') { | 1059 if (p[0] == '.' && p[1] == '.' && p[2] == '/') { |
1060 goto unsafe; | 1060 goto unsafe; |
1061 } | 1061 } |
1062 | 1062 |
1063 #if (NGX_WIN32) | 1063 #if (NGX_WIN32) |
1064 | 1064 |
1068 | 1068 |
1069 if (len > 3) { | 1069 if (len > 3) { |
1070 | 1070 |
1071 /* detect "/.../" */ | 1071 /* detect "/.../" */ |
1072 | 1072 |
1073 if (p[3] == '/' || p[3] == '\\') { | 1073 if (p[0] == '.' && p[1] == '.' && p[2] == '.' |
1074 && (p[3] == '/' || p[3] == '\\')) | |
1075 { | |
1074 goto unsafe; | 1076 goto unsafe; |
1075 } | 1077 } |
1076 } | 1078 } |
1077 #endif | 1079 #endif |
1078 } | 1080 } |