[PATCH] 0.10.2 html comment problem

David Relson relson at osagesoftware.com
Mon Feb 3 23:49:05 CET 2003


Greetings,

Greg Louis wins the kewpie doll for finding the first defect in the newly 
released version of bogofilter.

The code to detect and remove html comments counts left and right angle 
brackets.  If there are more rights than lefts, it can get confused and do 
the wrong thing.

Here's the patch:

Index: html.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/html.c,v
retrieving revision 1.1
diff -u -r1.1 html.c
--- html.c	3 Feb 2003 16:55:14 -0000	1.1
+++ html.c	3 Feb 2003 22:38:38 -0000
@@ -87,7 +87,8 @@
  		    buf_used -= tmp + 1 - buf_start;
  		}
  		tmp = buf_start;
-		level -= 1;
+		if (level > 0)
+		    level -= 1;
  	    }
  	}
  	else {

The patch has been applied to the 0.10.2 and head branches of the cvs 
repository.

I'll build 0.10.2.1 (beta) this evening.

David
-------------- next part --------------
Index: html.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/html.c,v
retrieving revision 1.1
diff -u -r1.1 html.c
--- html.c	3 Feb 2003 16:55:14 -0000	1.1
+++ html.c	3 Feb 2003 22:38:38 -0000
@@ -87,7 +87,8 @@
 		    buf_used -= tmp + 1 - buf_start;
 		}
 		tmp = buf_start;
-		level -= 1;
+		if (level > 0)
+		    level -= 1;
 	    }
 	}
 	else {



More information about the Bogofilter mailing list