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.