mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 13:09: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);
|
ifaces = getinterfaces(&numifaces, NULL, 0);
|
||||||
|
|
||||||
|
if (ifaces == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
for (ifnum = 0; ifnum < numifaces; ifnum++) {
|
for (ifnum = 0; ifnum < numifaces; ifnum++) {
|
||||||
if ((strcmp(ifaces[ifnum].devfullname, iname) == 0 ||
|
if ((strcmp(ifaces[ifnum].devfullname, iname) == 0 ||
|
||||||
strcmp(ifaces[ifnum].devname, iname) == 0) &&
|
strcmp(ifaces[ifnum].devname, iname) == 0) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user