dovecot: Crashfix for converting invalid input to UTF-8.

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 14 21:48:15 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/ff4431c2272d
changeset: 7239:ff4431c2272d
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 14 21:48:19 2008 +0200
description:
Crashfix for converting invalid input to UTF-8.

diffstat:

1 file changed, 2 insertions(+), 1 deletion(-)
src/lib-charset/charset-iconv.c |    3 ++-

diffs (13 lines):

diff -r 5e4c711a0c06 -r ff4431c2272d src/lib-charset/charset-iconv.c
--- a/src/lib-charset/charset-iconv.c	Wed Feb 13 20:23:12 2008 +0200
+++ b/src/lib-charset/charset-iconv.c	Thu Feb 14 21:48:19 2008 +0200
@@ -104,7 +104,8 @@ charset_to_utf8_try(struct charset_trans
 	else {
 		/* should be EILSEQ */
 		*result = CHARSET_RET_INVALID_INPUT;
-		buffer_set_used_size(dest, dest->used - destleft);
+		if (!dtcase)
+			buffer_set_used_size(dest, dest->used - destleft);
 		uni_ucs4_to_utf8_c(UNICODE_REPLACEMENT_CHAR, dest);
 		return TRUE;
 	}


More information about the dovecot-cvs mailing list