diff src/http/ngx_http_request.c @ 928:a6fe6bedb9e3

fix segfault when $host is used and *) request is "GET http://host" without CR or LF, or timed out *) request is "GET http://host" with a large blank space
author Igor Sysoev <igor@sysoev.ru>
date Fri, 15 Dec 2006 10:24:57 +0000
parents 49d03c183ad2
children b3d642b5e4bb
line wrap: on
line diff
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1104,7 +1104,9 @@ ngx_http_alloc_large_header_buffer(ngx_h
 
         if (r->host_start) {
             r->host_start = new + (r->host_start - old);
-            r->host_end = new + (r->host_end - old);
+            if (r->host_end) {
+                r->host_end = new + (r->host_end - old);
+            }
         }
 
         if (r->port_start) {