From: Eric Salama Date: Thu, 21 Dec 2017 13:30:07 +0000 (+0100) Subject: BUG/MEDIUM: lua: fix crash when using bogus mode in register_service() X-Git-Tag: v1.9-dev1~558 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe7456f3b78ca1721d7f10d9df073ed8174f83c0;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: lua: fix crash when using bogus mode in register_service() 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. --- diff --git a/src/hlua.c b/src/hlua.c index 2c28e67329..abd096d030 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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;