]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: proxy: avoid NULL-deref in post_section_px_cleanup()
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 7 Aug 2025 11:04:26 +0000 (13:04 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 7 Aug 2025 20:26:47 +0000 (22:26 +0200)
commit3759172015de8873be66098f76eef83447f8255c
tree9fc84b3873f4134e048420629319d1ee67cbffe6
parent833158f9e0f4dad3502a7b7d7fbadb97e5a6c6dc
BUG/MINOR: proxy: avoid NULL-deref in post_section_px_cleanup()

post_section_px_cleanup(), which was implemented in abcc73830
("MEDIUM: proxy: register a post-section cleanup function"), is called
for the current section no matter if the parsing was aborted due to
a fatal error. In this case, the curproxy pointer may point to NULL,
yet post_section_px_cleanup() assumes curproxy pointer is always valid,
which could lead to NULL-deref.

For instance, the config below will cause SEGFAULT:

  listen toto titi

To fix the issue, let's simply consider that the curproxy pointer may
be NULL in post_section_px_cleanup(), in which case we skip the cleanup
for the curproxy since there is nothing we can do.

No backport needed
src/proxy.c