]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hlua: segfault when loading the same filter from different contexts
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 11 Mar 2024 12:49:56 +0000 (13:49 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 13 Mar 2024 08:24:46 +0000 (09:24 +0100)
Trying to register the same lua filter from global and per-thread context
(using 'lua-load' + 'lua-load-per-thread') causes a segmentation fault in
hlua_post_init().

This is due to a simple copy paste error as we try to print the function
name in the error message (like we do when loading the same lua function
from different contexts) instead of the filter name.

This should be backported up to 2.6.

src/hlua.c

index b95d024cae1f852a8bda0bf44edeb7ab1debd6dd..9578923be9cc38be0bfb7f264005e4948f486c76 100644 (file)
@@ -13320,7 +13320,7 @@ int hlua_post_init()
                if ((reg_flt->flt_ref[0] == -1) == (ret < 0)) {
                        ha_alert("Lua filter '%s' is referenced both ins shared Lua context (through lua-load) "
                                 "and per-thread Lua context (through lua-load-per-thread). these two context "
-                                "exclusive.\n", fcn->name);
+                                "exclusive.\n", reg_flt->name);
                        errors++;
                }
        }