Long, folded "To:" line [was: easier bug to fix?]

David Relson relson at osagesoftware.com
Tue Sep 2 23:19:19 CEST 2003


On Tue, 02 Sep 2003 16:12:54 -0400
Jason Rennie <jrennie at ai.mit.edu> wrote:

> Sorry to be a pest... but, it seems I may have run into another bug. 
> When I train bogofilter on the attached message, I get the following
> error:
> 
> Invalid buffer size, exiting.
> Aborted
> 
> My guess is that the From: line is too long (9126 bytes).  It wouldn't
> be so bad if bogofilter were to just ignore the message and go on.  
> Currently, bogofilter stops dead.  This is bad for me because I give
> it many MH directories to process all at once.  If bogofilter dies in
> the middle, it misses most of my e-mail.
> 
> Jason

Jason,

The following patch prevents a very, very long unfolded line from
overflowing the buffer.  Flex-2.5.4 uses an 8k buffer and your message's
folded "To:" line has 9k - thus the problem.  Since the standards
specify the line length not exceed 998 chars, this should be fine (with
the extra addresses not being tagged as "to:userid").

--- lexer.c	2 Sep 2003 16:19:04 -0000	1.63
+++ lexer.c	2 Sep 2003 21:13:50 -0000
@@ -205,6 +206,8 @@
 		convert_eol(text, ' ');
 	    }
 	}
+	if (buff->size - count < 1000)
+	    break;
     }
     return count;
 }




More information about the Bogofilter mailing list