mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 17:41:52 +03:00
Small fix on the top of #950 to sanity check the variable before use it
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user