]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stick-table: Never exceed (MAX_SESS_STKCTR-1) when fetching a stkctr
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 21 Oct 2019 08:53:34 +0000 (10:53 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 21 Oct 2019 09:17:04 +0000 (11:17 +0200)
commita9fa88a1eac9bd0ad2cfb761c4b69fd500a1b056
treebbe97a49c24c2b899315a9d96f7a1ee01b49faa8
parente566f3db11e781572382e9bfff088a26dcdb75c5
BUG/MINOR: stick-table: Never exceed (MAX_SESS_STKCTR-1) when fetching a stkctr

When a stick counter is fetched, it is important that the requested counter does
not exceed (MAX_SESS_STKCTR -1). Actually, there is no bug with a default build
because, by construction, MAX_SESS_STKCTR is defined to 3 and we know that we
never exceed the max value. scN_* sample fetches are numbered from 0 to 2. For
other sample fetches, the value is tested.

But there is a bug if MAX_SESS_STKCTR is set to a lower value. For instance
1. In this case the counters sc1_* and sc2_* may be undefined.

This patch fixes the issue #330. It must be backported as far as 1.7.
src/stick_table.c