1
0
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:
david
2009-07-28 22:34:48 +00:00
parent d29a3b7c36
commit 7194d27631

View File

@@ -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);
}