1
0
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:
david
2008-09-04 14:36:48 +00:00
parent a9799715e5
commit 76dd72ba94

View File

@@ -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) {