INN commit: trunk/lib (hashtab.c)

INN Commit rra at isc.org
Thu Jun 25 19:44:59 UTC 2015


    Date: Thursday, June 25, 2015 @ 12:44:59
  Author: iulius
Revision: 9907

lib/hashtab.c: hash_size() would overflow if target=0

Thanks to Richard Kettlewell for the patch.

Modified:
  trunk/lib/hashtab.c

-----------+
 hashtab.c |    3 +++
 1 file changed, 3 insertions(+)

Modified: hashtab.c
===================================================================
--- hashtab.c	2015-06-22 18:00:00 UTC (rev 9906)
+++ hashtab.c	2015-06-25 19:44:59 UTC (rev 9907)
@@ -57,6 +57,9 @@
     int n;
     size_t size;
 
+    if (target == 0) {
+        return 4;
+    }
     size = target - 1;
     for (n = 0; size > 0; n++)
         size >>= 1;



More information about the inn-committers mailing list