From syl@alcor.concordia.ca Thu Jan 20 10:23:57 2000
Return-Path: <syl@alcor.concordia.ca>
Delivered-To: md@wonderland.linux.it
Received: by wonderland.linux.it (Postfix, from userid 10)
	id E0F4198A8; Thu, 20 Jan 2000 10:23:57 +0100 (CET)
Received: (from uucp@localhost)
	by giano.linux.it (8.9.3/8.9.3/Md) with UUCP id CAA10359
	for md@wonderland.linux.it; Thu, 20 Jan 2000 02:05:08 +0100
Received: from alcor.concordia.ca (syl@alcor.Concordia.CA [132.205.7.51])
	by kirk.linux.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id BAA26574
	for <md@linux.it>; Thu, 20 Jan 2000 01:20:42 +0100
Received: (from syl@localhost)
	by alcor.concordia.ca (8.8.7/8.8.7) id UAA04363;
	Wed, 19 Jan 2000 20:01:58 -0500 (EST)
Date: Wed, 19 Jan 2000 20:01:58 -0500 (EST)
From: Sylvain Robitaille <syl@alcor.concordia.ca>
Message-Id: <200001200101.UAA04363@alcor.concordia.ca>
To: md@linux.it, inn-workers@isc.org
Subject: Re: Distribution bug
In-Reply-To: <20000119223928.A2979@wonderland.linux.it>
References: <20000119223928.A2979@wonderland.linux.it>
Status: RO
Content-Length: 2192

You wrote to the Inn-workers mailing list:

>Can somebody send me the patch for fixing the "Distribution: ," bug?
>I need it for the debian INN 1.7.2 package.

Appended is the patch I applied to my Inn-1.7 server.

I hope that helps...

-- 
----------------------------------------------------------------------
Sylvain Robitaille                              syl@alcor.concordia.ca
 
Systems analyst                                   Concordia University
Instructional & Information Technology        Montreal, Quebec, Canada
----------------------------------------------------------------------



--- inn-1.7.2.orig/innd/art.c
+++ inn-1.7.2/innd/art.c
@@ -1943,6 +1943,27 @@
     p = HDR(_distribution);
     distributions = *p ? CommaSplit(p) : NULL;
     if (distributions) {
+	/*
+	 * 1999/11/18 Sylvain Robitaille: Adapted from a patch posted to
+	 *            the inn-workers mailing list by Don Lewis. Reject
+	 *            articles with a malformed Distribution: header.
+	 *            Ensure not only that we are pointing to a non-null
+	 *            string, but also that our *pointer* is not null to
+	 *            begin with.
+	 */
+	if (distributions[0] == '\0' || *distributions[0] == '\0') {
+	    (void)sprintf(buff, "%d bogus distribution \"%s\"",
+			  NNTP_REJECTIT_VAL, MaxLength(p, p));
+	    ARTlog(&Data, ART_REJECT, buff);
+#if defined(DO_REMEMBER_TRASH)
+	    if (Mode == OMrunning && !HISwrite(&Data, ""))
+		syslog(L_ERROR, "%s cant write history %s %m",
+			LogName, Data.MessageID);
+#endif /* defined(DO_REMEMBER_TRASH) */
+	    DISPOSE(distributions);
+	    ARTreject(buff, article);
+	    return buff;
+	} else {
 	DISTparse(distributions, &Data);
 	if (ME.Distributions
 	 && !DISTwantany(ME.Distributions, distributions)) {
@@ -1959,6 +1980,7 @@
 	    ARTreject(buff, article);
 	    return buff;
 	}
+	}
     }
     else {
 	Data.Distribution = "?";
