dovecot-2.0: lib-charset: Don't assert-crash when iconv() skips ...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jun 21 23:18:01 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/28cfb347296a
changeset: 11603:28cfb347296a
user: Timo Sirainen <tss at iki.fi>
date: Mon Jun 21 21:17:58 2010 +0100
description:
lib-charset: Don't assert-crash when iconv() skips lots of invalid input.
diffstat:
src/lib-charset/charset-iconv.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (22 lines):
diff -r 172a0c7cebbb -r 28cfb347296a src/lib-charset/charset-iconv.c
--- a/src/lib-charset/charset-iconv.c Mon Jun 21 17:23:25 2010 +0100
+++ b/src/lib-charset/charset-iconv.c Mon Jun 21 21:17:58 2010 +0100
@@ -131,7 +131,7 @@
{
bool dtcase = (t->flags & CHARSET_FLAG_DECOMP_TITLECASE) != 0;
enum charset_result result;
- size_t pos, used, size, prev_used = 0;
+ size_t pos, used, size, prev_pos = 0, prev_used = 0;
bool ret;
for (pos = 0;;) {
@@ -151,7 +151,8 @@
(void)buffer_append_space_unsafe(dest, size);
buffer_set_used_size(dest, used);
} else {
- i_assert(dest->used != prev_used);
+ i_assert(dest->used != prev_used || pos != prev_pos);
+ prev_pos = pos;
prev_used = dest->used;
}
}
More information about the dovecot-cvs
mailing list