From 05817ac1224ed1fc9853095b312dfface4fd3479 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Mon, 14 May 2001 21:04:35 +0000 Subject: Replicate the semantics of the libunicode utf8 functions by returning NULL 2001-05-14 Jon Trowbridge * camel-search-private.c (utf8_get): Replicate the semantics of the libunicode utf8 functions by returning NULL in the arg on invalid utf8. * camel-pgp-context.c (pgp_verify): Check for valid utf8, terminate loop if something looks wrong. * camel-mime-utils.c (header_encode_phrase_get_words): Properly check for invalid utf8. (header_encode_string): Properly check for invalid utf8. * camel-charset-map.c (camel_charset_step): Properly check for invalid utf8. 2001-05-14 Jon Trowbridge * e-html-utils.c (is_citation): Check for bad utf8. svn path=/trunk/; revision=9798 --- e-util/ChangeLog | 4 ++++ e-util/e-html-utils.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index abf4fcc7ee..d0cf6a5369 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,7 @@ +2001-05-14 Jon Trowbridge + + * e-html-utils.c (is_citation): Check for bad utf8. + 2001-05-08 Dan Winship * e-path.c (e_path_find_folders): Walk a hierarchy using the diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index 1561492454..e79d5e2192 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -145,7 +145,7 @@ is_citation (const unsigned char *c, gboolean saw_citation) } /* Check for "Rupert> " and the like... */ - for (i = 0; c && *c && *c != '\n' && i < 10; i ++, c = g_utf8_next_char (c)) { + for (i = 0; c && *c && g_unichar_validate (g_utf8_get_char (c)) && *c != '\n' && i < 10; i ++, c = g_utf8_next_char (c)) { u = g_utf8_get_char (c); if (u == '>') return TRUE; @@ -304,7 +304,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) } } - if (u == (gunichar)-1) { + if (!g_unichar_validate (u)) { /* Sigh. Someone sent undeclared 8-bit data. * Assume it's iso-8859-1. */ -- cgit v1.2.3