BUG in art.c:2284 ARTpost() causes core

Andrew McNamara andrewm at connect.com.au
Thu Nov 18 23:06:10 UTC 1999


>Your patch has a slight memory leak.  Here's my patch (to an old and heavily
>patched version of INN) that tosses the article to protect unpatched
>downstream servers.  I don't know for sure if my patch works though, since
>we haven't been offered any broken articles since I installed the patch.

I tried something like this first up, but the null list comes about as
a result of DISTparse() cleaning the list. You need to move the call to
DISTparse() above the check on the first element of the list.

>--- art.c-	Thu Oct 29 02:11:38 1998
>+++ art.c	Wed Nov 17 22:09:14 1999
>@@ -1887,6 +1887,20 @@
>     p = HDR(_distribution);
>     distributions = *p ? CommaSplit(p) : NULL;
>     if (distributions) {
>+      if (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)) {
>@@ -1903,6 +1917,7 @@
> 	    ARTreject(buff, article);
> 	    return buff;
> 	}
>+      }
>     }
>     else {
> 	Data.Distribution = "?";
>
 ---
Andrew McNamara (System Architect)

connect.com.au Pty Ltd
Lvl 3, 213 Miller St, North Sydney, NSW 2060, Australia
Phone: +61 2 9409 2117, Fax: +61 2 9409 2111


More information about the inn-workers mailing list