From 7194d276312f909c2b43c1ac55562ab3a805139f Mon Sep 17 00:00:00 2001 From: david Date: Tue, 28 Jul 2009 22:34:48 +0000 Subject: [PATCH] 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. --- tcpip.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcpip.cc b/tcpip.cc index 03035b17b..516879996 100644 --- a/tcpip.cc +++ b/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); }