results with latest beta

David Relson relson at osagesoftware.com
Sat Jan 25 22:24:33 CET 2003


At 03:54 PM 1/25/03, Matt Armstrong wrote:

>Matt Armstrong <matt at lickey.com> writes:
>
> > For the first time bogofilter 0.10.x can parse my SPAM mailbox without
> > crashing -- yay!  It gets the message count wrong (6916 messages -vs-
> > the actual 6899 in one mbox, 9372 -vs- the actual 9362 in another).
>
>Strangely, a subset of my spam mailbox crashes bogofilter:
>
>     http://www.lickey.com/~matt/bogo/crash.mbox.gz
>
>(a 31k download)

Matt,

Looking at the code, it appears that input buffers weren't being NUL 
terminated, which could result in the code doing bad things.  The patch 
below works on your sample mailbox.  Give it a try on something bigger :-)


--- 01011/lexer.c       2003-01-25 08:32:32.000000000 -0500
+++ cvs/lexer.c 2003-01-25 16:20:56.000000000 -0500
@@ -1,4 +1,4 @@
-/* $Id: lexer.c,v 1.9 2003/01/25 13:32:32 relson Exp $ */
+/* $Id: lexer.c,v 1.11 2003/01/25 21:20:56 relson Exp $ */

  /*
   * NAME
@@ -107,6 +107,7 @@
  int get_decoded_line(byte *buf, size_t max_size)
  {
      int count;
+    max_size -= 1;     /* leave spot for NUL termination */

      if (yysave == NULL)
         count = yy_get_new_line(buf, max_size);
@@ -167,7 +168,9 @@
         *(buf + count - 1) = '\n';
      }

+    buf[count] = '\0'; /* NUL terminate the buffer */
+
      return count;
  }






More information about the bogofilter-dev mailing list