INN commit: trunk/nnrpd (article.c)

INN Commit rra at isc.org
Sat Dec 26 09:57:02 UTC 2009


    Date: Saturday, December 26, 2009 @ 01:57:01
  Author: iulius
Revision: 8862

Adjust the length of retlen when we have to realloc retval.
Fix after commit 8861.

Modified:
  trunk/nnrpd/article.c

-----------+
 article.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Modified: article.c
===================================================================
--- article.c	2009-12-26 00:06:18 UTC (rev 8861)
+++ article.c	2009-12-26 09:57:01 UTC (rev 8862)
@@ -534,8 +534,8 @@
 		    retlen = q - p + VirtualPathlen + 2;
 		    retval = xmalloc(retlen);
 		} else {
-		    if ((q - p + VirtualPathlen + 1) > retlen) {
-			retlen = q - p + VirtualPathlen + 1;
+		    if ((q - p + VirtualPathlen + 2) > retlen) {
+			retlen = q - p + VirtualPathlen + 2;
                         retval = xrealloc(retval, retlen);
 		    }
 		}
@@ -574,6 +574,7 @@
 		    for (; (r < q) && isspace((int)*r) ; r++);
 		    if (r == q)
 			return NULL;
+                    /* Copy the virtual path without its final '!'. */
 		    memcpy(retval, VirtualPath, VirtualPathlen - 1);
 		    memcpy(retval + VirtualPathlen - 1, r - 1, q - r + 1);
 		    *(retval + (int)(q - r) + VirtualPathlen) = '\0';
@@ -887,6 +888,7 @@
     return field;
 }
 
+
 /*
 **  Dump parts of the overview database with the OVER command.
 **  The legacy XOVER is also kept, with its specific behaviour.
@@ -1039,6 +1041,7 @@
                 }
                 continue;
             }
+            /* Copy the virtual path without its final '!'. */
 	    if(useIOb) {
 		SendIOb(data, p - data);
 		SendIOb(VirtualPath, VirtualPathlen - 1);




More information about the inn-committers mailing list