[SHELL32] Fix a potential buffer overrun.
authorEric Kohl <eric.kohl@reactos.org>
Sun, 7 Oct 2018 20:53:30 +0000 (22:53 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 7 Oct 2018 20:56:16 +0000 (22:56 +0200)
Patch by Kudratov Olimjon.

CORE-8545

dll/win32/shell32/CShellLink.cpp

index d6d12ef..92f6296 100644 (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);