[evolution-patches] backported fix



this is a fix that has been in the unstable branch for a while I
realized today it should go into stable as well.

--Larry
Index: htmltextslave.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmltextslave.c,v
retrieving revision 1.111
retrieving revision 1.111.2.1
diff -u -p -r1.111 -r1.111.2.1
--- htmltextslave.c	7 Oct 2002 15:26:16 -0000	1.111
+++ htmltextslave.c	30 Mar 2003 23:02:58 -0000	1.111.2.1
@@ -470,7 +470,7 @@ hts_fit_line (HTMLObject *o, HTMLPainter
 	begin = html_text_slave_remove_leading_space (slave, painter, lineBegin);
 
 	sep = begin;
-	while (sep
+	while (sep && *sep
 	       && widthLeft >= html_text_slave_nb_width (slave, painter, words + 1)) {
 		words ++;
 		lsep   = sep;
@@ -498,7 +498,10 @@ hts_fit_line (HTMLObject *o, HTMLPainter
 			rv = next_to_floating ? HTML_FIT_NONE : HTML_FIT_COMPLETE;
 		else {
 			words ++;
-			sep    = strchr (sep + (words > 1 ? 0 : 1), ' ');
+
+			if (sep)
+				sep    = strchr (sep + (words > 1 ? 0 : 1), ' ');
+
 			pos    = sep ? g_utf8_pointer_to_offset (begin, sep) : g_utf8_strlen (begin, -1);
 		}
 	}
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.1579.2.5
retrieving revision 1.1579.2.6
diff -u -p -r1.1579.2.5 -r1.1579.2.6
--- ChangeLog	24 Mar 2003 15:22:07 -0000	1.1579.2.5
+++ ChangeLog	30 Mar 2003 23:02:58 -0000	1.1579.2.6
@@ -1,3 +1,8 @@
+2003-03-30  Larry Ewing  <lewing ximian com>
+
+	* htmltextslave.c (hts_fit_line): backport fixes from 3.0.x to
+	avoid NULL dereferences.
+
 2003-03-23  Larry Ewing  <lewing ximian com>
 
 	* htmlengine.c (remove_font_style): always make sure that if there


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]