changeset 7240:fcfe2ea5c3ed HEAD

Crashfix for converting invalid input to UTF-8.
author Timo Sirainen <tss@iki.fi>
date Thu, 14 Feb 2008 21:48:18 +0200
parents 0e8339ad1932
children a6c066f50877
files src/lib-charset/charset-iconv.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-charset/charset-iconv.c	Wed Feb 13 20:23:11 2008 +0200
+++ b/src/lib-charset/charset-iconv.c	Thu Feb 14 21:48:18 2008 +0200
@@ -104,7 +104,8 @@
 	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;
 	}