mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Check return value of getinterfaces. Fixes #3032
This commit is contained in:
parent
4ed1ce0eee
commit
3496617f8f
1 changed files with 3 additions and 0 deletions
|
|
@ -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) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue