8000 libnetutil/netutil.c: getInterfaceByName Possible pointer dereference? · Issue #3032 · nmap/nmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

libnetutil/netutil.c: getInterfaceByName Possible pointer dereference? #3032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service ACAA and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stasos24 opened this issue Feb 22, 2025 · 0 comments
Closed
Labels

Comments

@stasos24
Copy link
stasos24 commented Feb 22, 2025

NOTE: Npcap issues have moved to the Npcap repository

NOTE: Ncrack issues have moved to the Ncrack repository

Describe the bug

nmap/libnetutil/netutil.cc

Lines 1458 to 1464 in fd80921

ifaces = getinterfaces(&numifaces, NULL, 0);
for (ifnum = 0; ifnum < numifaces; ifnum++) {
if ((strcmp(ifaces[ifnum].devfullname, iname) == 0 ||
strcmp(ifaces[ifnum].devname, iname) == 0) &&
ifaces[ifnum].addr.ss_family == af)
return &ifaces[ifnum];

Return value of "getinterfaces" function is not checked
It may return Null therefore null pointer dereference may occur at 1461

Expected behavior
Usually there is pointer check:

nmap/libnetutil/netutil.cc

Lines 1435 to 1439 in fd80921

ifaces = getinterfaces(&numifaces, NULL, 0);
if (ifaces == NULL)
return -1;

Version info (please complete the following information):

master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant
0