BUG/MEDIUM: stick-table: fix regression caused by recent fix for out-of-memory
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Nov 2016 17:21:39 +0000 (18:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Nov 2016 17:21:39 +0000 (18:21 +0100)
commit5179146fa35a74c46a4bf4bcd58c97696edc9810
treeb7dc73ed3a1193318b9a3b1cbef8e7cb3212fcc0
parent733b1327a698158f3ac34231f7bf3a7bfdf6a719
BUG/MEDIUM: stick-table: fix regression caused by recent fix for out-of-memory

Commit ef8f4fe ("BUG/MINOR: stick-table: handle out-of-memory condition
gracefully") unfortunately got trapped by a pointer operation. Replacing

    ts = poll_alloc() + size;

with :

    ts = poll_alloc();
    ts += size;

Doesn't give the same result because pool_alloc() is void while ts is a
struct stksess*. So now we don't access the same places, which is visible
in certain stick-table scenarios causing a crash.

This must be backported to 1.6 and 1.5.
src/stick_table.c