https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1e20a3e5b58f3f30e31b0360ce318c7b5196e770

commit 1e20a3e5b58f3f30e31b0360ce318c7b5196e770
Author:     Eric Kohl <[email protected]>
AuthorDate: Sun Oct 7 22:53:30 2018 +0200
Commit:     Eric Kohl <[email protected]>
CommitDate: Sun Oct 7 22:56:16 2018 +0200

    [SHELL32] Fix a potential buffer overrun.
    
    Patch by Kudratov Olimjon.
    
    CORE-8545
---
 dll/win32/shell32/CShellLink.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp
index d6d12efe0a..92f62961cf 100644
--- a/dll/win32/shell32/CShellLink.cpp
+++ b/dll/win32/shell32/CShellLink.cpp
@@ -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);

Reply via email to