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