mirror of
https://github.com/nmap/nmap.git
synced 2026-01-20 05:09:02 +00:00
Add a guard against getaddrinfo returning an empty list of addresses in
l_nsock_connect. It hasn't been reported to cause problems but will cause a crash if it ever happens.
This commit is contained in:
@@ -451,6 +451,11 @@ static int l_nsock_connect(lua_State *L) {
|
||||
lua_pushstring(L, error);
|
||||
return 2;
|
||||
}
|
||||
if (dest == NULL) {
|
||||
lua_pushboolean(L, false);
|
||||
lua_pushstring(L, "getaddrinfo returned success but no addresses");
|
||||
return 2;
|
||||
}
|
||||
|
||||
udata->nsiod = nsi_new(nsp, NULL);
|
||||
if (o.spoofsource) {
|
||||
|
||||
Reference in New Issue
Block a user