]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: sample: correctly reinitialize sample fetch context before calling sample_...
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Jun 2014 14:56:41 +0000 (16:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Jun 2014 15:12:08 +0000 (17:12 +0200)
commit6c616e0b96106dd33d183afbda31e72799e967c3
tree90af1839bcd1c00eb2f9ec7dce5868a5f8054de1
parentd713bcc326da5d1ac80adab666d7710f3e37650c
BUG/MAJOR: sample: correctly reinitialize sample fetch context before calling sample_process()

We used to only clear flags when reusing the static sample before calling
sample_process(), but that's not enough because there's a context in samples
that can be used by some fetch functions such as auth, headers and cookies,
and not reinitializing it risks that a pointer of a different type is used
in the wrong context.

An example configuration which triggers the case consists in mixing hdr()
and http_auth_group() which both make use of contexts :

     http-request add-header foo2 %[hdr(host)],%[http_auth_group(foo)]

The solution is simple, initialize all the sample and not just the flags.
This fix must be backported into 1.5 since it was introduced in 1.5-dev19.
src/proto_http.c
src/sample.c