INN commit: trunk/innd (art.c)

INN Commit Russ_Allbery at isc.org
Sat Oct 25 23:26:13 UTC 2008


    Date: Saturday, October 25, 2008 @ 16:26:12
  Author: iulius
Revision: 8149

Fix a bug when articles were fed to innd via IHAVE or TAKETHIS
with an empty body:  the article terminator was not recognized.
Therefore, subsequent NNTP commands were eaten inside the article...

Thanks to Wolfgang M. Weyand for having reported this issue.

Modified:
  trunk/innd/art.c

-------+
 art.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Modified: art.c
===================================================================
--- art.c	2008-10-25 18:12:55 UTC (rev 8148)
+++ art.c	2008-10-25 23:26:12 UTC (rev 8149)
@@ -947,11 +947,24 @@
 
         /* Saw \r.  We're just scanning for the article terminator, so if we
            don't have at least five characters left, we can save effort and
-           stop now. */
+           stop now.
+           We also have to check whether the body begins with the article
+           terminator. */
+        if ((i == data->Body + 1) && (bp->used - i > 1)
+            && (memcmp(&bp->data[i - 1], ".\r\n", 3) == 0)) {
+            if (cp->State == CSeatarticle)
+                cp->State = CSgotlargearticle;
+            else
+                cp->State = CSgotarticle;
+            cp->Next = i + 2;
+            return;
+        }
+
         if (bp->used - i < 5) {
             cp->Next = i;
             return;
         }
+
         if (memcmp(&bp->data[i], "\r\n.\r\n", 5) == 0) {
             if (cp->State == CSeatarticle)
                 cp->State = CSgotlargearticle;



More information about the inn-committers mailing list