DEBUG: fd: make sure we never try to insert/delete an impossible FD number
authorWilly Tarreau <w@1wt.eu>
Mon, 31 Jan 2022 19:05:02 +0000 (20:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Feb 2022 13:36:23 +0000 (14:36 +0100)
commitd2c64a10ad1ee63a2df2911a760c345d350acf5b
tree9f3dfe509f4c77bc2aa0abb6087779c07bb79397
parentc468633a3ad12d33bf9bf3d7ac139b22bf0997bb
DEBUG: fd: make sure we never try to insert/delete an impossible FD number

It's among the cases that would provoke memory corruption, let's add
some tests against negative FDs and those larger than the table. This
must never ever happen and would currently result in silent corruption
or a crash. Better have a noticeable one exhibiting the call chain if
that were to happen.

(cherry picked from commit 9aa324de2d9f69d74f5b30c33a78d3a38501342f)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/fd.h
src/fd.c