INN commit: branches/2.5/innd (art.c)

INN Commit rra at isc.org
Sun Nov 15 09:19:55 UTC 2009


    Date: Sunday, November 15, 2009 @ 01:19:55
  Author: iulius
Revision: 8758

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

See also commit 8149 for the same issue with an empty body.

Modified:
  branches/2.5/innd/art.c

-------+
 art.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Modified: art.c
===================================================================
--- art.c	2009-11-15 09:19:39 UTC (rev 8757)
+++ art.c	2009-11-15 09:19:55 UTC (rev 8758)
@@ -903,14 +903,24 @@
            terminator (five characters).  If we don't have at least five more
            characters, we're guaranteed that the article isn't complete, so
            save ourselves complexity and just return and wait for more
-           data. */
+           data.
+           We also have to check whether the headers begin with the article
+           terminator. */
+        if ((i == cp->Start + 1) && (bp->used - i > 1)
+            && (memcmp(&bp->data[i - 1], ".\r\n", 3) == 0)) {
+            ARTerror(cp, "Empty article");
+            cp->State = CSnoarticle;
+            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 (i == cp->Start) {
-                ARTerror(cp, "Empty article");
+                ARTerror(cp, "Empty headers and body");
                 cp->State = CSnoarticle;
             } else {
                 ARTerror(cp, "No body");




More information about the inn-committers mailing list