]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: session: fix a possible crash with src_tracked
authorThierry FOURNIER <tfournier@exceliance.fr>
Mon, 14 Apr 2014 23:15:52 +0000 (01:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 15 Apr 2014 09:09:49 +0000 (11:09 +0200)
commitd988f21589b1fd215bba4f72a11d656d5d50b77c
treeb6e38d71ae54146fc5e1774d3deb3a73a5db1b54
parent1be69105abccec526afdf7b94611473312a931db
BUG/MAJOR: session: fix a possible crash with src_tracked

Since commit 4d4149c ("MEDIUM: counters: support passing the counter
number as a fetch argument"), the sample fetch sc_tracked(num) became
equivalent to sc[0-9]_tracked, by using the same smp_fetch_sc_tracked()
function.

This was theorically made possible after the series of changes starting
with commit a65536ca ("MINOR: counters: provide a generic function to
retrieve a stkctr for sc* and src."). Unfortunately, while all other
functions were changed to use the generic primitive smp_fetch_sc_stkctr(),
smp_fetch_sc_tracked() was forgotten and is not able to differentiate
between sc_tracked, src_tracked and sc[0-9]_tracked. The resulting mess is
that if sc_tracked is used, the counter number is assumed to be 47 because
that's what remains after subtracting "0" from char "_".

Fix this by simply relying on the generic function as should have been
done. The bug was introduced in 1.5-dev20. No backport is needed.
src/session.c