Dear Maintainer,
in libgmime v. 3.2.13+dfsg-2, the funktion g_mime_utils_header_decode_text()
sometimes fails to decode chunked header lines, like “=?utf-8?B?VGhpcw==?=
=?utf-8?B?IGlzIGEgdGVzdCE=?=”, which returns the value “This” instead of the
correct “This is a test!”. Apparently the issue has been fixed at least in
GMime v. 3.2.15.
To reproduce, compile the following trivial code
<snip>
#include <gmime/gmime.h>
int
main(int argc, char **argv)
{
int n;
g_mime_init();
for (n = 1; n < argc; n++) {
gchar *result;
g_printf("arg: '%s'\n", argv[n]);
result = g_mime_utils_header_decode_text(NULL, argv[n]);
g_printf("res: '%s'\n", result);
g_free(result);
}
return 0;
}
</snip>
and call it with the example value above:
<snip>
$ ./decode-test '=?utf-8?B?VGhpcw==?= =?utf-8?B?IGlzIGEgdGVzdCE=?='
arg: '=?utf-8?B?VGhpcw==?= =?utf-8?B?IGlzIGEgdGVzdCE=?='
res: 'This'
$ LD_PRELOAD=~/Neues/gmime-3.2.15/gmime/.libs/libgmime-3.0.so.0.214.1 ./decode-
test '=?utf-8?B?VGhpcw==?= =?utf-8?B?IGlzIGEgdGVzdCE=?='
arg: '=?utf-8?B?VGhpcw==?= =?utf-8?B?IGlzIGEgdGVzdCE=?='
res: 'This is a test!'
</snip>
As the issue may lead to incorrect information being displayed to the user,
IMHO it is a serious bug.
Thanks, Albrecht.