From: Aurelien DARRAGON Date: Thu, 10 Apr 2025 15:35:53 +0000 (+0200) Subject: BUG/MINOR: hlua: fix invalid errmsg use in hlua_init() X-Git-Tag: v3.2-dev10~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea3c96369f4a5def90888c9207cd88010d473eb4;p=thirdparty%2Fhaproxy.git BUG/MINOR: hlua: fix invalid errmsg use in hlua_init() errmsg is used with memprintf and friends, thus it must be NULL initialized before being passed to memprintf, else invalid read will occur. However in hlua_init() the errmsg value isn't initialized, let's fix that This is really minor because it would only cause issue on error paths, yet it may be backported to all stable versions, just in case. --- diff --git a/src/hlua.c b/src/hlua.c index a48267d88..b57e946fc 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -14459,7 +14459,7 @@ lua_State *hlua_init_state(int thread_num) void hlua_init(void) { int i; - char *errmsg; + char *errmsg = NULL; #ifdef USE_OPENSSL struct srv_kw *kw; int tmp_error;