Index: camel/camel-mime-filter-tohtml.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-filter-tohtml.c,v
retrieving revision 1.22
diff -u -p -r1.22 camel-mime-filter-tohtml.c
--- camel/camel-mime-filter-tohtml.c	12 Apr 2006 19:14:13 -0000	1.22
+++ camel/camel-mime-filter-tohtml.c	2 Nov 2006 04:42:17 -0000
@@ -204,7 +204,7 @@ writeln (CamelMimeFilter *filter, const 
 			/* otherwise, FALL THROUGH */
 		case ' ':
 			if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES
-			    && ((inptr == (in + 1) || *inptr == ' ' || *inptr == '\t'))) {
+			    && ((inptr == (in + 1) || (inptr < inend && (*inptr == ' ' || *inptr == '\t'))))) {
 				outptr = g_stpcpy (outptr, "&nbsp;");
 				html->column++;
 				break;
