INN commit: branches/2.4/innfeed (host.c)

INN Commit Russ_Allbery at isc.org
Sat Apr 26 11:32:18 UTC 2008


    Date: Saturday, April 26, 2008 @ 04:32:18
  Author: iulius
Revision: 7801

Fix a bug in hostDeleteIpv4Addr():  after innfeed has called that
function, host->nextIpAddr can point outside the host->ipAddrs[] array.

Modified:
  branches/2.4/innfeed/host.c

--------+
 host.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Modified: host.c
===================================================================
--- host.c	2008-04-26 11:30:30 UTC (rev 7800)
+++ host.c	2008-04-26 11:32:18 UTC (rev 7801)
@@ -1277,10 +1277,10 @@
   for (i = 0, j = 0; host->ipAddrs[i]; i++) {
     if (host->ipAddrs[i]->sa_family != AF_INET)
       host->ipAddrs[j++] = host->ipAddrs[i];
-    if (i == host->nextIpAddr)
-      host->nextIpAddr -= (i - j);
   }
   host->ipAddrs[j] = 0;
+  if (host->nextIpAddr >= j)
+      host->nextIpAddr = 0;
 }
 #endif
 



More information about the inn-committers mailing list