]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: lua: Fix dumping of stick table entries for STD_T_DICT
authorAdis Nezirovic <anezirovic@haproxy.com>
Tue, 5 May 2020 11:57:28 +0000 (13:57 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 7 May 2020 13:51:36 +0000 (15:51 +0200)
commitad9f9ed3f48c296a3f0fbe961ab142161c79c461
treea767d17fbcfa5393c7f979931abccc64ef554906
parent083eff37348f9bae8157af93c27f4d6bc89877e5
BUG/MEDIUM: lua: Fix dumping of stick table entries for STD_T_DICT

The issue can easily be reproduced with "stick on" statement

backend BE_NAME
    stick-table type ip size 1k
    stick on src

and calling dump() method on BE_NAME stick table from Lua

Before the fix, HAProxy would return 500 and log something like
the following:
  runtime error: attempt to index a string value from [C] method 'dump'

Where one would expect a Lua table like this:

{
    ["IP_ADDR"] = {
        ["server_id"] = 1,
        ["server_name"] = "srv1"
    }
}

This patch needs to backported to 1.9 and later releases.
src/hlua_fcn.c