INN commit: trunk/innd (art.c)
INN Commit
rra at isc.org
Fri Oct 23 20:57:19 UTC 2009
Date: Friday, October 23, 2009 @ 13:57:16
Author: iulius
Revision: 8682
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:
trunk/innd/art.c
-------+
art.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
Modified: art.c
===================================================================
--- art.c 2009-10-23 19:32:40 UTC (rev 8681)
+++ art.c 2009-10-23 20:57:16 UTC (rev 8682)
@@ -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