]> git.kaiwu.me - haproxy.git/commit
MINOR: stick-tables: make stktable_release() do nothing on NULL
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Jun 2018 04:25:57 +0000 (06:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Jun 2018 04:33:20 +0000 (06:33 +0200)
commit43e903553edc94bb9b33e965f37d8d218f7d1482
tree24b37a9492aadb10346797ea21b397bdfb27f063
parent65189c17c694b0b44e0d324d63c055f5329e61c9
MINOR: stick-tables: make stktable_release() do nothing on NULL

stktable_release() has been involved in two recent crashes by being
used without enough care. Just like any free() function this one is
often called on an exit path with a possibly unsafe argument. Given
that there is another case (smp_fetch_sc_trackers()) which theorically
could call it with an unchecked NULL, though it cannot happen since
the function doesn't support being called with src_* hence cannot make
use of tmpstkctr, let's rather move the check into the function itself
to make it safer for the long term.

This patch could be backported to 1.8 as a strengthening measure.
src/stick_table.c