]> mj.ucw.cz Git - checkmail.git/commit
Fix rfc2047 decoding buffer overflow
authorJan Hadrava <had@kam.mff.cuni.cz>
Sat, 9 Sep 2023 23:00:27 +0000 (01:00 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 22 Sep 2023 11:05:01 +0000 (13:05 +0200)
commit515a643a86d443e28442dc0e41640483b7671f0c
treefb19f41568d541fb371f6a0ce89f594d4badade0
parent610ac7b0dcf84647e5bfec637512eb807c0f88d7
Fix rfc2047 decoding buffer overflow

If the rfc2047_decode_word() function fails, only the failed word is
copied into the output.

In the previous version, the rest of the header was copied as well,
which resulted in repetition in the output. This repetition, combined
with the lack of checking the length of the output buffer, could have
led to writing outside the allocated memory.
charset.c