INN commit: trunk/nnrpd (article.c)

INN Commit rra at isc.org
Wed Jun 17 17:04:13 UTC 2009


    Date: Wednesday, June 17, 2009 @ 10:04:13
  Author: iulius
Revision: 8510

* Fix an inaccuracy in the count of overview stats.

* Also fix a potential segfault in case overview_getheader()
  returns a NULL pointer (though it should not for the Message-ID).

Modified:
  trunk/nnrpd/article.c

-----------+
 article.c |   22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

Modified: article.c
===================================================================
--- article.c	2009-06-11 18:42:30 UTC (rev 8509)
+++ article.c	2009-06-17 17:04:13 UTC (rev 8510)
@@ -994,17 +994,31 @@
 
 	vector = overview_split(data, len, NULL, vector);
 	r = overview_getheader(vector, OVERVIEW_MESSAGE_ID, OVextra);
+        if (r == NULL) {
+            if (PERMaccessconf->nnrpdoverstats) {
+                gettimeofday(&stv, NULL);
+            }
+            continue;
+        }
 	cache_add(HashMessageID(r), token);
 	free(r);
 	if (VirtualPathlen > 0 && overhdr_xref != -1) {
-	    if ((size_t)(overhdr_xref + 1) >= vector->count)
-		continue;
+            if ((size_t)(overhdr_xref + 1) >= vector->count) {
+                if (PERMaccessconf->nnrpdoverstats) {
+                    gettimeofday(&stv, NULL);
+                }
+                continue;
+            }
 	    p = vector->strings[overhdr_xref] + sizeof("Xref: ") - 1;
 	    while ((p < data + len) && *p == ' ')
 		++p;
 	    q = memchr(p, ' ', data + len - p);
-	    if (q == NULL)
-		continue;
+            if (q == NULL) {
+                if (PERMaccessconf->nnrpdoverstats) {
+                    gettimeofday(&stv, NULL);
+                }
+                continue;
+            }
 	    if(useIOb) {
 		SendIOb(data, p - data);
 		SendIOb(VirtualPath, VirtualPathlen - 1);




More information about the inn-committers mailing list