winedump: Fix buffer overflow in debugstr_wn helper.

This commit is contained in:
Piotr Caban 2022-10-15 20:12:00 +02:00 committed by Alexandre Julliard
parent cfbe32d557
commit cf78df3612

View file

@ -49,7 +49,7 @@ static const char *debugstr_wn(const WCHAR *wstr, unsigned int n)
i = 0;
p = buf;
*p++ = '\"';
while (i < n && i < sizeof(buf) - 2 && wstr[i])
while (i < n && i < sizeof(buf) - 3 && wstr[i])
{
if (wstr[i] < 127) *p++ = wstr[i];
else *p++ = '.';