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
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 2c1ac95..f6dcd6a 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1104,7 +1104,9 @@
 
         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) {