[USER32] InternalGetWindowText: Write to caller's buffer only when one was provided...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 15 Jan 2018 10:45:41 +0000 (12:45 +0200)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 15 Jan 2018 10:45:41 +0000 (12:45 +0200)
win32ss/user/user32/windows/window.c

index fd00648..388ef25 100644 (file)
@@ -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;
 }