6 Nov
2023
6 Nov
'23
12:06 p.m.
Piotr Caban (@piotr) commented about dlls/msvcrt/mbcs.c:
- if (get_mbcinfo()->ismbcodepage) - { - while (*src && n) + unsigned char* ret = dst; + pthreadmbcinfo mbcinfo; + + if (!n) + return dst; + if (!MSVCRT_CHECK_PMT(dst && src)) { - n--; - if (_ismbblead(*src)) - { - if (!*(src+1)) + *ret = -1; + return ret; This looks questionable. I didn't test it but the function should probably return NULL in case of invalid argument. Also the code may crash. If destination parameter should be reset to 0 - please add a test covering that.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4284#note_51017