Mercurial > hg > nginx-quic
changeset 3105:8ed781b3bc02 stable-0.6
merge 2411:
handle "/../" case more reliably
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Sep 2009 11:57:04 +0000 |
parents | c2537655fd5f |
children | fabd6e1028f2 |
files | src/http/ngx_http_parse.c |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -1123,11 +1123,15 @@ ngx_http_parse_complex_uri(ngx_http_requ #endif case '/': state = sw_slash; - u -= 4; - if (u < r->uri.data) { - return NGX_HTTP_PARSE_INVALID_REQUEST; - } - while (*(u - 1) != '/') { + u -= 5; + for ( ;; ) { + if (u < r->uri.data) { + return NGX_HTTP_PARSE_INVALID_REQUEST; + } + if (*u == '/') { + u++; + break; + } u--; } break;