]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: lua: fix crash when using bogus mode in register_service()
authorEric Salama <esalama@haproxy.com>
Thu, 21 Dec 2017 13:30:07 +0000 (14:30 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 22 Dec 2017 13:34:54 +0000 (14:34 +0100)
When using an incorrect 'mode' as 2nd argument of core.register_service(),
HAProxy crashes while displaying the error message.

To be backported to 1.8, 1.7 and 1.6.

src/hlua.c

index 2c28e673299e85a61409237ce990af11a3be5555..abd096d030d4fdf48bea0f27e53202a51ef113f7 100644 (file)
@@ -6871,7 +6871,7 @@ __LJMP static int hlua_register_service(lua_State *L)
                akl->kw[0].parse = action_register_service_http;
        else
                WILL_LJMP(luaL_error(L, "lua service environment '%s' is unknown. "
-                                       "'tcp' or 'http' are expected."));
+                                       "'tcp' or 'http' are expected.", env));
 
        akl->kw[0].match_pfx = 0;
        akl->kw[0].private = fcn;