mirror of
https://github.com/nmap/nmap.git
synced 2026-08-27 11:55:27 +00:00
Restore correct behavior of socket:get_info() and others
Since Nmap 7.93, requesting certain operations on an unconnected NSE socket would result in a Lua error being thrown instead of the (nil, message) return that was expected. vnc-info and the http.lua library both use socket:get_info() as a check for whether the socket is connected. This restores the expected behavior. Fixes #3424
This commit is contained in:
parent
84420aa300
commit
042376289d
1 changed files with 2 additions and 2 deletions
|
|
@ -445,9 +445,9 @@ static nse_nsock_udata *check_nsock_udata (lua_State *L, int idx, bool open)
|
|||
#define NSOCK_UDATA_ENSURE_OPEN(L, nu) \
|
||||
do { \
|
||||
if (nu->nsiod == NULL) \
|
||||
return luaL_error(L, "socket must be connected"); \
|
||||
return nseU_safeerror(L, "socket must be connected"); \
|
||||
if (nu->af == NSE_AF_PCAP) \
|
||||
return luaL_error(L, "invalid operation on pcap socket"); \
|
||||
return nseU_safeerror(L, "invalid operation on pcap socket"); \
|
||||
} while (0)
|
||||
|
||||
static int l_loop (lua_State *L)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue