diff --git a/contrib/modsecurity/modsec_wrapper.c b/contrib/modsecurity/modsec_wrapper.c index 1daaddbd5..370682bcf 100644 --- a/contrib/modsecurity/modsec_wrapper.c +++ b/contrib/modsecurity/modsec_wrapper.c @@ -325,7 +325,11 @@ int modsecurity_process(struct worker *worker, struct modsecurity_parameters *pa req->content_type = apr_table_get(req->headers_in, "Content-Type"); req->content_encoding = apr_table_get(req->headers_in, "Content-Encoding"); req->hostname = apr_table_get(req->headers_in, "Host"); - req->parsed_uri.hostname = chunk_strdup(req, req->hostname, strlen(req->hostname)); + if (req->hostname != NULL) { + req->parsed_uri.hostname = chunk_strdup(req, req->hostname, strlen(req->hostname)); + } else { + req->parsed_uri.hostname = NULL; + } lang = apr_table_get(req->headers_in, "Content-Languages"); if (lang != NULL) {