Distribution bug

Sylvain Robitaille syl at alcor.concordia.ca
Thu Jan 20 01:01:58 UTC 2000


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 at alcor.concordia.ca
 
Systems analyst                                   Concordia University
Instructional & Information Technology        Montreal, Quebec, Canada
----------------------------------------------------------------------
*** innd/art.c.19991118 Thu Sep  3 13:38:49 1998
--- innd/art.c  Thu Nov 18 17:01:07 1999
***************
*** 1913,1918 ****
--- 1913,1940 ----
      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)) {
***************
*** 1929,1934 ****
--- 1951,1957 ----
            ARTreject(buff, article);
            return buff;
        }
+       }
      }
      else {
        Data.Distribution = "?";



More information about the inn-workers mailing list