diff --git a/encoding.c b/encoding.c index b86a547e..a76e9d53 100644 --- a/encoding.c +++ b/encoding.c @@ -2039,7 +2039,11 @@ retry: xmlBufferShrink(in, toconv); out->use += written; writtentot += written; - } + /* multichar cut at end of buffer can generate that problem */ + if (ret == -2) { + ret = -3; + } + } out->content[out->use] = 0; } #ifdef LIBXML_ICONV_ENABLED