]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hlua: fix invalid errmsg use in hlua_init()
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 10 Apr 2025 15:35:53 +0000 (17:35 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 10 Apr 2025 20:10:26 +0000 (22:10 +0200)
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

index a48267d887c5841e8169e48a54423d1386ffd53a..b57e946fc5a57077f46f294c364a895f2b1d6c69 100644 (file)
@@ -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;