BUG/MEDIUM: lua: segfault if a converter or a sample doesn't return anything
authorThierry FOURNIER <thierry.fournier@ozon.io>
Fri, 12 May 2017 14:32:20 +0000 (16:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 May 2017 14:46:26 +0000 (16:46 +0200)
commitfd80df11c37af2d5d3c9a8659d45905638de717c
treee012baa05aec0d9b77ad8e496fbca6e97cbd1c86
parent1bfc24ba03e4ae05fc76ba16119f24a226cd79c2
BUG/MEDIUM: lua: segfault if a converter or a sample doesn't return anything

In the case of a Lua sample-fetch or converter doesn't return any
value, an acces outside the Lua stack can be performed. This patch
check the stack size before converting the top value to a HAProxy
internal sample.

A workaround consist to check that a value value is always returned
with sample fetches and converters.

This patch should be backported in the version 1.6 and 1.7
src/hlua.c