]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: lua: segfault when calling haproxy sample fetches from lua
authorCyril Bonté <cyril.bonte@free.fr>
Sun, 1 Mar 2015 23:08:41 +0000 (00:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 Mar 2015 12:41:09 +0000 (13:41 +0100)
commit928ae5c82248b2e53d854f988df413e63e4c5943
tree781a4ed102bcb65543b50923ac5b007ed553a35f
parentdc0306e3e4f823db7e7bd2d6d031041b58a35fef
BUG/MEDIUM: lua: segfault when calling haproxy sample fetches from lua

When a Lua script calls an internal haproxy sample fetch, it may segfault in
some conditions :
- when a fetch has no argument,
- when there is no room left to store the special type ARGT_STOP in the argument
  list (this one shouldn't happen currently as there isn't any sample fetch with
  enough arguments to fill the allocated buffer).

Example of Lua code which reproduces a segfault :
core.register_fetches("segfault", function(txn, ...)
  return txn.req_ver(txn)
end)
src/hlua.c