Small fix on the top of #950 to sanity check the variable before use it

This commit is contained in:
Felipe Zimmerle
2015-12-10 14:40:32 -03:00
parent 10bc802ee0
commit 169e918a64

View File

@@ -363,7 +363,12 @@ ngx_http_modsecurity_load_request(ngx_http_request_t *r)
/* &r->headers_in.user); */ /* &r->headers_in.user); */
req->parsed_uri.fragment = (char *)ngx_pstrdup0(r->pool, &r->exten); req->parsed_uri.fragment = (char *)ngx_pstrdup0(r->pool, &r->exten);
if (&r->headers_in != NULL && &r->headers_in.server != NULL) {
req->hostname = (char *)ngx_pstrdup0(r->pool, &r->headers_in.server); req->hostname = (char *)ngx_pstrdup0(r->pool, &r->headers_in.server);
} else {
req->hostname = (char *)ngx_pstrdup0(r->pool,
(ngx_str_t *)&ngx_cycle->hostname);
}
if (r->header_only) { if (r->header_only) {
req->header_only = r->header_only; req->header_only = r->header_only;