From c4b45acae326b9d5d74f70070ee3999121fd41e3 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Tue, 29 Mar 2016 12:34:55 +0800 Subject: [PATCH] sproto: check args --- lualib-src/sproto/lsproto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lualib-src/sproto/lsproto.c b/lualib-src/sproto/lsproto.c index 22e53189..6214fdc9 100644 --- a/lualib-src/sproto/lsproto.c +++ b/lualib-src/sproto/lsproto.c @@ -532,6 +532,9 @@ lprotocol(lua_State *L) { lua_pushstring(L, name); } else { const char * name = lua_tostring(L, 2); + if (name == NULL) { + return luaL_argerror(L, 2, "Should be number or string"); + } tag = sproto_prototag(sp, name); if (tag < 0) return 0;