]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: hlua_fcn: ensure systematic bref cleanup for patref list iterator
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 7 Aug 2026 15:07:36 +0000 (17:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Aug 2026 09:08:39 +0000 (11:08 +0200)
commitffd262eed88eae9a7723529ae3cd073cd9ac4063
tree20dbf50f5fa95bf1983e371a1596d41605aa893d
parente85323dcebc5f270b0d2f69706230f0fbc4ac650
BUG/MEDIUM: hlua_fcn: ensure systematic bref cleanup for patref list iterator

Similar bug as aeff2a3b2a ("BUG/MEDIUM: hlua_fcn: ensure systematic watcher
cleanup for server list iterator") but this time it affects patref list
iterator.

If the patref list iteration is interrupted (ie: break away from the loop
or lua error), we still need to unlink the bref we set earlier because
the hlua_patref_iterator_context is a temporary object so we cannot
let a reference once the object is dead. Obviously this can corrupt
the pattern reference element bref "users" list and lead to invalid
reads as well.

Reported-by: Claude (ANT-2026-DARC9AY8)
It should be backported up to 3.2 where hlua patref API was implemented.
src/hlua_fcn.c