]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: listener: fix potential null pointer dereference in listener_release()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 2 Dec 2024 15:22:28 +0000 (16:22 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Mon, 2 Dec 2024 16:22:45 +0000 (17:22 +0100)
commitb167426b6bf64f1c5ade38dfe4bf12379170a8b7
tree4c32a023a1ccf2b5b6b2c82ade7f724dcd2b45c9
parenta582b9c18dc1f5fad69f72f88f0fb87bc8b16859
BUG/MINOR: listener: fix potential null pointer dereference in listener_release()

As reported by @Bbulatov on GH #2804, fe is found at multiple places in
listener_release(): in some places it is first checked against NULL before
being de-referenced while in some other places it is not, which is
ambiguous and could hide a bug.

In practise, fe cannot be NULL for now, but it might not be the case in
the future as we want to keep the possibility to run isolated listeners
(that is, without proxy attached).

We've already ensured this was the case with a57786e ("BUG/MINOR:
listener: null pointer dereference suspected by coverity"), but
this promise was recently broken by 65ae134 ("BUG/MINOR: listener: Wake
proxy's mngmt task up if necessary on session release").

Let's fix that by conditionning the block with an "else if" statement
instead of a regular "else".

No need for backport except if multi-connection protocols (ie: FTP) were
to be backported as well.
src/listener.c