diff options
Diffstat (limited to 'camel/camel-charset-map.c')
-rw-r--r-- | camel/camel-charset-map.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/camel/camel-charset-map.c b/camel/camel-charset-map.c index d7aa8763dd..f33c8082dd 100644 --- a/camel/camel-charset-map.c +++ b/camel/camel-charset-map.c @@ -227,11 +227,12 @@ camel_charset_step(CamelCharset *c, const char *in, int len) gunichar c; const char *newinptr; newinptr = g_utf8_next_char(inptr); - if (newinptr == NULL) { + c = g_utf8_get_char(inptr); + if (newinptr == NULL || !g_unichar_validate (c)) { inptr++; continue; } - c = g_utf8_get_char(inptr); + inptr = newinptr; if (c<=0xffff) { mask &= charset_mask(c); |