6 Nov
2023
6 Nov
'23
1:56 p.m.
Piotr Caban (@piotr) commented about dlls/msvcrt/tests/string.c:
expect_bin(buf, "\x00\xff", 2); }
+ memset(buf, 0xff, sizeof(buf)); + errno = 0xdeadbeef; + ret = _mbsncpy(NULL, mbstring, 1); + ok(ret == NULL, "_mbsncpy returned %p, expected NULL\n", ret); + ok(errno == EINVAL, "_mbsncpy returned %d\n", errno); + + memset(buf, 0xff, sizeof(buf)); + errno = 0xdeadbeef; + ret = _mbsncpy(buf, NULL, 1); + ok(ret == NULL, "_mbsncpy returned %p, expected NULL\n", ret); + ok(errno == EINVAL, "_mbsncpy returned %d\n", errno);
You're not checking `buf` content after `_mbsncpy` call. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4284#note_51044