https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6318e47bb9a7598eec633ff26b31b237b4b414bc

commit 6318e47bb9a7598eec633ff26b31b237b4b414bc
Author:     Giannis Adamopoulos <[email protected]>
AuthorDate: Mon Jan 15 12:45:41 2018 +0200
Commit:     Giannis Adamopoulos <[email protected]>
CommitDate: Mon Jan 15 12:45:41 2018 +0200

    [USER32] InternalGetWindowText: Write to caller's buffer only when one was 
provided. CORE-13614
---
 win32ss/user/user32/windows/window.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/win32ss/user/user32/windows/window.c 
b/win32ss/user/user32/windows/window.c
index fd006481d1..388ef25bb1 100644
--- a/win32ss/user/user32/windows/window.c
+++ b/win32ss/user/user32/windows/window.c
@@ -1799,7 +1799,7 @@ int WINAPI
 InternalGetWindowText(HWND hWnd, LPWSTR lpString, int nMaxCount)
 {
     INT Ret = NtUserInternalGetWindowText(hWnd, lpString, nMaxCount);
-    if (Ret == 0)
+    if (Ret == 0 && lpString)
         *lpString = L'\0';
     return Ret;
 }

Reply via email to