mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 12:19:02 +00:00
Check return value of getinterfaces. Fixes #3032
This commit is contained in:
@@ -1459,6 +1459,9 @@ struct interface_info *getInterfaceByName(const char *iname, int af) {
|
||||
|
||||
ifaces = getinterfaces(&numifaces, NULL, 0);
|
||||
|
||||
if (ifaces == NULL)
|
||||
return NULL;
|
||||
|
||||
for (ifnum = 0; ifnum < numifaces; ifnum++) {
|
||||
if ((strcmp(ifaces[ifnum].devfullname, iname) == 0 ||
|
||||
strcmp(ifaces[ifnum].devname, iname) == 0) &&
|
||||
|
||||
Reference in New Issue
Block a user