mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-02-26 13:52:42 +08:00
There was some confusion as to whether the destination buffer length should include space for the null terminator. Some callers of the function assumed that a terminator would be added beyond the end of the stated buffer size, while others did not. Make everything consistent and also fix an overrun when there was insufficient space for the output in the non-iconv implementation. As stated in a code comment, a better solution would follow the lead of libxls and use wcstombs and friends when iconv is not available. But this gets into the weeds with conversion functions named differently across platforms. The goal here is to fix the buffer overrun. See oss-fuzz/28773