Skip to content

Allocate big enough buffer for text conversion

Buffer for conversion from Unicode to ASCII7 in unicodeToAscii7() can be small in some cases leading to invalid writes which can result in crash when freeing another string as can be seen in https://bugzilla.redhat.com/show_bug.cgi?id=1730406 (see e.g. https://sha.org/assets/documents/Trademarks%20on%20Base-Metal%20Tableware.pdf for the reproducer).

This commit increases size of the buffer from (len * 2 + 1) to (len * 8 + 1) since the 8 is upper limit for conversion of single character passed to UnicodeMap::mapUnicode().

Merge request reports