]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: hlua_fcn: fix broken yield for Patref:add_bulk()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 12 Jan 2026 15:57:59 +0000 (16:57 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Mon, 12 Jan 2026 16:30:52 +0000 (17:30 +0100)
commit04545cb2b718286aa917d5aa80579fff305caf06
tree91764ae743ab21dd1e05644237e2a84f562ab35e
parentb1cfeeef218d8e65aa982485f54613bf3deb3fd5
BUG/MINOR: hlua_fcn: fix broken yield for Patref:add_bulk()

In GH #3241, GH user @kanashimia reported that the Patref:add_bulk()
method would raise a Lua exception when called with more than 101
elements at once.

As identified by @kanashimia there was an error in the way the
add_bulk() method was forced to yield after 101 elements precisely.
The yield is there to ensure Lua doesn't eat too much ressources at
once and doesn't impact haproxy's core responsiveness, but the check
for the yield was misplaced resulting in improper stack content upon
resume.

Thanks to user @kanashimia who even provided a reproducer which helped
a lot to troubleshoot the issue.

This fix should be backported up to 3.2 with 884dc62 ("MINOR: hlua_fcn:
add Patref:add_bulk()") where the bug was introduced.
src/hlua_fcn.c