[USER32] InternalGetWindowText: Write to caller's buffer only when one was provided. CORE-13614

This commit is contained in:
Giannis Adamopoulos 2018-01-15 12:45:41 +02:00
parent bd193c4534
commit 6318e47bb9

View file

@ -1799,7 +1799,7 @@ int WINAPI
InternalGetWindowText(HWND hWnd, LPWSTR lpString, int nMaxCount) InternalGetWindowText(HWND hWnd, LPWSTR lpString, int nMaxCount)
{ {
INT Ret = NtUserInternalGetWindowText(hWnd, lpString, nMaxCount); INT Ret = NtUserInternalGetWindowText(hWnd, lpString, nMaxCount);
if (Ret == 0) if (Ret == 0 && lpString)
*lpString = L'\0'; *lpString = L'\0';
return Ret; return Ret;
} }