charset_to_utf8 assertion of remaining src_size

Xin Li delphij at delphij.net
Fri May 15 17:58:23 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

I have seen the following assertion fails on my own mail server
(indexer-worker):

Panic: file charset-iconv.c: line 132 (charset_to_utf8): assertion
failed: (*src_size - pos <= CHARSET_MAX_PENDING_BUF_SIZE)

However, when charset_to_utf8_try returns FALSE (e.g. iconv() got
EINVAL or EILSEQ), the for loop in charset_to_utf8 may end earlier,
and there may be additional pending characters, and the assertion
doesn't seem always hold in the error case, perhaps we should assert
that pos is non-zero in the error case?

Cheers,
- -- 
Xin LI <delphij at delphij.net>    https://www.delphij.net/
FreeBSD - The Power to Serve!           Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.1.2 (FreeBSD)

iQIcBAEBCgAGBQJVVjO/AAoJEJW2GBstM+nsbKUP/29fYdZArCiUSStK0hCtRvC3
o4L35zq4iP4WUry7VqNtdMg2Uiythei9l0JokNOJAy2ZDktJ3ns9CArXHi/pJE7/
V8374Iu9ygb4tzDvcNY/353SFkN+Sw4pJzSGJTelVT8nHxahQMtN7E0u26l54zNx
p1H8rgt2nVA8eRvKL9MrhudN3eSI2+Jq4HX+dR4/Tu4qLkSU1nqi8sopQxNXzW4C
4XG4haSbTtXLu0H1MGa8y5pmwrFmZEluNOBm2SOww+UqeteD/MwE/pgA7g+cQx8l
/t3FWzSe4C9HROV1VGW5V5HDM7cDvNJZ+nxQGI6L6qInkCBqQx/muIb9nIe7dhro
tiHIuX4h8X2zaga+iD+B9fkf4QpDUc11WYE+0DUArb2cNTTAgeTXQ68+g0Q+UC8s
OxUVDA4KwOSzkpEifDgvVCdgPG7U87SGe9NlMGjSZvAIEPsww16A3f2IaM4fhFa2
lVuTh1wq8phdWXLbCbZ0F36hAyxVbbwC5Xyj4Ygy3QL4RiBC7CJJ8I4f1lRLnoFz
1Wg0/M7psXBLVN7vx2MKtK5Rj1OvMOKmL4VpkhKcnp2z/Y9I5Qq2CP4C5uOv3DLJ
JjoCsnVDpWJKQo6EPleb9OxVJF+NmjHd63zimXbuUyDJ7AJCsx/0m9mJZ5QYf+jU
U3OqESCU5e5q++QLd2Kl
=ksoA
-----END PGP SIGNATURE-----


More information about the dovecot mailing list