From a38a3140dde2e8d20aadbe9dd04b8d4c0a14e37b Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Fri, 14 Aug 2015 17:32:59 +0800 Subject: [PATCH] error when send to address 0 --- lualib-src/lua-skynet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lualib-src/lua-skynet.c b/lualib-src/lua-skynet.c index c92ff98d..7d75d2ce 100644 --- a/lualib-src/lua-skynet.c +++ b/lualib-src/lua-skynet.c @@ -172,6 +172,9 @@ _send(lua_State *L) { uint32_t dest = (uint32_t)lua_tointeger(L, 1); const char * dest_string = NULL; if (dest == 0) { + if (lua_type(L,1) == LUA_TNUMBER) { + return luaL_error(L, "Invalid service address 0"); + } dest_string = get_dest_string(L, 1); }