Clean the garbage character after the duplicated charset property

Pull request #148 by zimmerle doesn't fix the problem. '\0' in format
string won't be processed by "ngx_vslprintf".
When the garbage character is '\n' or '\r', http response is cracked and
browsers may go crashing.
This commit is contained in:
ahuango 2013-12-12 14:22:30 +08:00 committed by Felipe Zimmerle
parent 74ec784005
commit b788ce2608

View File

@ -615,7 +615,7 @@ ngx_http_modsecurity_load_headers_out(ngx_http_request_t *r)
}
ngx_snprintf(content_type, content_type_len,
"%V; charset=%V\0",
"%V; charset=%V%Z",
&r->headers_out.content_type,
&r->headers_out.charset);