From 8ebb40798bb34b4d7f77ef464283b5de72bdd0b0 Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:47:18 +0800 Subject: [PATCH] fix lua stack corruption --- src/api/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/process.c b/src/api/process.c index fb8665bd..ad2a7321 100644 --- a/src/api/process.c +++ b/src/api/process.c @@ -264,8 +264,8 @@ static int f_read_stderr(lua_State* L) static int f_read(lua_State* L) { - int stream = luaL_checknumber(L, 1); - lua_remove(L, 1); // remove the number we just read + int stream = luaL_checknumber(L, 2); + lua_remove(L, 2); return g_read(L, stream); }