1
0
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:
dmiller
2025-06-09 19:58:44 +00:00
parent 4ed1ce0eee
commit 3496617f8f

View File

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