[SHELL32] Fix a potential buffer overrun.

Patch by Kudratov Olimjon.

CORE-8545
This commit is contained in:
Eric Kohl 2018-10-07 22:53:30 +02:00
parent bb7292b287
commit 1e20a3e5b5

View file

@ -519,7 +519,7 @@ static LPWSTR Stream_LoadPath(LPCSTR p, DWORD maxlen)
{
UINT len = 0;
while (p[len] && len < maxlen)
while (len < maxlen && p[len])
len++;
UINT wlen = MultiByteToWideChar(CP_ACP, 0, p, len, NULL, 0);