INN commit: trunk/innd (util.c)

INN Commit Russ_Allbery at isc.org
Sun Dec 14 05:01:47 UTC 2008


    Date: Saturday, December 13, 2008 @ 21:01:47
  Author: eagle
Revision: 8224

Handle the second argument being NULL in a call to MaxLength, which can
happen in some pathological error handling cases.  Found by Saturn in
2007.

Modified:
  trunk/innd/util.c

--------+
 util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Modified: util.c
===================================================================
--- util.c	2008-12-14 04:58:29 UTC (rev 8223)
+++ util.c	2008-12-14 05:01:47 UTC (rev 8224)
@@ -62,7 +62,7 @@
     }
 
     /* Simple case of just want the begining? */
-    if ((unsigned)(q - p) < sizeof buff - 4) {
+    if (q == NULL || (unsigned)(q - p) < sizeof buff - 4) {
         strlcpy(buff, p, sizeof(buff) - 3);
         strlcat(buff, "...", sizeof(buff));
     }




More information about the inn-committers mailing list