[PATCH] long lines
David Relson
relson at osagesoftware.com
Sun Jan 26 19:51:58 CET 2003
Allyn,
With the patch below, bogofilter handles your "killer message" just
fine. Bogofilter tries to load the full input line into the lexer's
buffer. As the buffer is limited in size (8K on Linux), an 11,000 html
line like you had doesn't fit at all well. The fix is to read as much as
will fit and return that.
David
Index: lexer.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/lexer.c,v
retrieving revision 1.11
diff -u -r1.11 lexer.c
--- lexer.c 25 Jan 2003 21:20:56 -0000 1.11
+++ lexer.c 26 Jan 2003 18:50:27 -0000
@@ -177,7 +186,7 @@
{
int cnt = 0;
/* check bytes needed vs. bytes in buff */
- while ( need > used) {
+ while (size-used > 2 && need > used) {
/* too few, read more */
int add = get_decoded_line(buf+used, size-used);
if (add == EOF) return EOF;
More information about the Bogofilter
mailing list