it looks like someone splited an utf-8 string wrongly,
leaving "half" a char on each part
g_mime_utils_header_decode_text/phrase split the header
into words and decode each word separately, and since it's
utf8, iconv isn't used and the string validates with this
loop:
while (!g_utf8_validate (p, len, (const char **) &p))
{
len
= declen - (p - (char *) decoded);
*p
= '?';
}
because the original string is poorly (brokenly) splited,
the 'half' chars are replaced with '?'
I'm attaching a patch that moves the utf-8 validation to
the end of g_mime_utils_header_decode_text/phrase, where these
decoded words are already combined
Best Regards
On Sat, Dec 17, 2011 at 6:49 PM,
Jeffrey Stedfast <fejj gnome org>
wrote:
Hi,
I've just released GMime 2.4.29 and 2.6.2 with your
fix (and other similar fixes).
Jeff
On 12/14/2011 01:26 PM, evil legacy wrote:
Hi,
After more debugging, I found that the
problem is when iconv (cd, NULL, NULL,
&outbuf, &outleft) tries to flush
the buffer to outbuf, but outbuf isn't big
enough to hold it.
This little patch to the charset_convert
function seems to fix this problem (works
for me):