From ea3c96369f4a5def90888c9207cd88010d473eb4 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Thu, 10 Apr 2025 17:35:53 +0200 Subject: [PATCH] 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. --- src/hlua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;