]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[BUG] http: correctly update the header list when removing two consecutive headers
authorWilly Tarreau <w@1wt.eu>
Sun, 28 Nov 2010 05:57:24 +0000 (06:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 28 Nov 2010 06:06:23 +0000 (07:06 +0100)
commit26db59ea6b1f7319f53aca34bc64c4f180247e98
treecddf449f2f025529a6343b596acf1e1c5aab0a78
parentb810554f8f45e4488965b5a2fbfcd2f825fa9d3d
[BUG] http: correctly update the header list when removing two consecutive headers

When a header is removed, the previous header's next pointer is updated
to reflect the next of the current header. However, when cycling through
the loop, we update the prev pointer to point to the deleted header, which
means that if we delete another header, it's the deleted header's next
pointer that will be updated, leaving the deleted header in the list with
a null length, which is forbidden.

We must just not update the prev pointer after a removal.

This bug was present when either "reqdel" and "rspdel" removed two consecutive
headers. It could also occur when removing cookies in either requests or
responses, but since headers were the last header processing, the issue
remained unnoticed.

Issue reported by Hank A. Paulson.

This fix must be ported to 1.4 and possibly 1.3.
src/proto_http.c