10 Mar
2023
10 Mar
'23
1:02 a.m.
LPWSTR __cdecl wcsncpy( LPWSTR s1, LPCWSTR s2, size_t n ) { WCHAR *ret = s1; **//When encountering 0, the loop will jump out directly, but the pointer of s1 has been++, which leads to the memory overflow of the second for** for ( ; n; n--) if (!(*s1++ = *s2++)) break; for ( ; n; n--) *s1++ = 0; return ret; } -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2363