patch to fix bogofilter hangs

David Relson relson at osagesoftware.com
Fri Jan 24 02:47:08 CET 2003


Greetings,

The patch below corrects the problems reported with bogofilter hanging.  If 
you are having trouble, please apply this patch and let me know if it does, 
indeed, fix your problems.

Thank you.

David

Update of /cvsroot/bogofilter/bogofilter
In directory sc8-pr-cvs1:/tmp/cvs-serv20525

Modified Files:
	lexer.c html.c
Log Message:
Fix EOF handling so EOF's don't hang bogofilter.

Index: lexer.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/lexer.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- lexer.c	22 Jan 2003 21:20:03 -0000	1.7
+++ lexer.c	24 Jan 2003 01:36:02 -0000	1.8
@@ -177,6 +177,7 @@
  	/* too few, read more */
  	int add = get_decoded_line(buf+used, size-used);
  	if (add == EOF) return EOF;
+	if (add == 0) break ;
  	cnt += add;
  	used += add;
      }

Index: html.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/html.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- html.c	20 Jan 2003 17:09:01 -0000	1.4
+++ html.c	24 Jan 2003 01:36:02 -0000	1.5
@@ -55,7 +55,7 @@
  	size_t need = (c == '<') ? COMMENT_START_LEN : 1;
  	if (need > (size_t) (buf_used - tmp)) {
  	    int new = buff_fill(need, tmp, buf_used - tmp, buf_end - tmp);
-	    if (new == EOF)
+	    if (new == 0 || new == EOF)
  		break;
  	    buf_used += new;
  	    continue;

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
bogofilter-cvs mailing list
bogofilter-cvs at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bogofilter-cvs 





More information about the Bogofilter mailing list