From db3f109c7d413dd2f3aa1da713288e3aa28fcc23 Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Thu, 7 Nov 2024 18:05:32 +0100 Subject: [PATCH] Zero initialize buffer in read_string() --- src/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script.c b/src/script.c index d9efb09..484c79f 100644 --- a/src/script.c +++ b/src/script.c @@ -255,7 +255,7 @@ static int read_string(lua_State *L) int timeout = lua_tointeger(L, 2); int ret = 0; - char *buffer = malloc(size); + char *buffer = calloc(1, size); if (buffer == NULL) { ret = -1; // Error