From 0ae839b2dd1f9ff916249cd13d302dfec4087be6 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Thu, 30 Sep 2021 11:24:36 +0800 Subject: [PATCH] Check req size , See #1481 --- lualib-src/lua-cluster.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lualib-src/lua-cluster.c b/lualib-src/lua-cluster.c index a050f3c0..da671278 100644 --- a/lualib-src/lua-cluster.c +++ b/lualib-src/lua-cluster.c @@ -366,6 +366,8 @@ lunpackrequest(lua_State *L) { msg = luaL_checklstring(L,1,&ssz); sz = (int)ssz; } + if (sz == 0) + return luaL_error(L, "Invalid req package. size == 0"); switch (msg[0]) { case 0: return unpackreq_number(L, (const uint8_t *)msg, sz);