]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG: backend: balance hdr was broken since 1.5-dev11
authorWilly Tarreau <w@1wt.eu>
Sat, 22 Sep 2012 16:36:29 +0000 (18:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 22 Sep 2012 16:36:29 +0000 (18:36 +0200)
commitce39bfb7c433f60bc3dd924b699d135c499c0efe
tree8841e6da2bef773c0655eb7976f3fc266133758e
parent290e63aa87e91a0ebb404f7783d4aae8a7df7cfb
BUG: backend: balance hdr was broken since 1.5-dev11

Alex Markham reported and diagnosed a bug appearing on 1.5-dev11,
causing a crash on x86_64 when header hashing is used. The cause is
a missing (int) cast causing a negative offset to appear positive
and the resulting pointer to go out of bounds.

The crash is not possible anymore since 1.5-dev12 because a second
bug caused the negative sign to disappear so the pointer is always
within range but always wrong, so balance hdr() never works anymore.

This fix restores the correct behaviour and ensures the sign is
correct.
include/common/buffer.h
src/backend.c