]> git.kaiwu.me - nginx.git/commitdiff
merge r3076, r3080:
authorIgor Sysoev <igor@sysoev.ru>
Mon, 7 Sep 2009 12:02:37 +0000 (12:02 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 7 Sep 2009 12:02:37 +0000 (12:02 +0000)
fix segfault when a header starts with "\rX"
and logging is set to info or debug level

src/http/ngx_http_parse.c

index b83810d2edd2754b76967c3d38d1950b47ab7845..de061c91d7e3466ddacaab75aaa4d49c82cf2a97 100644 (file)
@@ -738,6 +738,7 @@ ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b)
 
         /* first char */
         case sw_start:
+            r->header_name_start = p;
             r->invalid_header = 0;
 
             switch (ch) {
@@ -750,7 +751,6 @@ ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b)
                 goto header_done;
             default:
                 state = sw_name;
-                r->header_name_start = p;
 
                 c = lowcase[ch];