]> git.kaiwu.me - nginx.git/commit
SPDY: fixed potential integer overflow while parsing headers.
authorValentin Bartenev <vbart@nginx.com>
Mon, 3 Mar 2014 15:24:55 +0000 (19:24 +0400)
committerValentin Bartenev <vbart@nginx.com>
Mon, 3 Mar 2014 15:24:55 +0000 (19:24 +0400)
commit0c05e5b55fe799bb0d6330bcf75dbde370bf0ba6
treeaa0174683c4bd7e41cdb385cc342c50c690d13e3
parent3925c1b110ef13a3e4130e95a06cc85594bc4494
SPDY: fixed potential integer overflow while parsing headers.

Previously r->header_size was used to store length for a part of
value that represents an individual already parsed HTTP header,
while r->header_end pointed to the end of the whole value.

Instead of storing length of a following name or value as pointer
to a potential end address (r->header_name_end and r->header_end)
that might be overflowed, now r->lowercase_index counter is used
to store remaining length of a following unparsed field.

It also fixes incorrect $body_bytes_sent value if a request is
closed while parsing of the request header.  Since r->header_size
is intended for counting header size, thus abusing it for header
parsing purpose was certainly a bad idea.
src/http/ngx_http_spdy.c