mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +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:
parent
d29a3b7c36
commit
7194d27631
1 changed files with 1 additions and 1 deletions
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue