sproto: check args

This commit is contained in:
Cloud Wu
2016-03-29 12:34:55 +08:00
parent cf50a582f2
commit c4b45acae3

View File

@@ -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;