mirror of
https://github.com/nmap/nmap.git
synced 2025-12-29 02:49:01 +00:00
Fix a logic error in getinterfaces_siocgifconf. The check for increasing
the capacity of the list of interfaces was off by one. This caused a crash on initialization for systems with more than 16 network interfaces.
This commit is contained in:
2
tcpip.cc
2
tcpip.cc
@@ -2965,7 +2965,7 @@ static struct interface_info *getinterfaces_siocgifconf(int *howmany) {
|
||||
continue;
|
||||
|
||||
/* Make room for this new interface if necessary. */
|
||||
if (count > capacity) {
|
||||
if (count >= capacity) {
|
||||
capacity <<= 2;
|
||||
devs = (struct interface_info *) safe_realloc(devs, sizeof(struct interface_info) * capacity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user