Commit 0161606b authored by Dan Kegel's avatar Dan Kegel Committed by Alexandre Julliard

advapi32: Don't test buffer length if buffer is null.

parent a4c10fda
......@@ -1811,7 +1811,7 @@ BOOL WINAPI GetServiceKeyNameA( SC_HANDLE hSCManager, LPCSTR lpDisplayName,
sizeW = *lpcchBuffer;
if (!GetServiceKeyNameW(hSCManager, lpDisplayNameW, lpServiceNameW, &sizeW))
{
if (*lpcchBuffer && lpServiceName)
if (lpServiceName && *lpcchBuffer)
lpServiceName[0] = 0;
*lpcchBuffer = sizeW*2; /* we can only provide an upper estimation of string length */
goto cleanup;
......@@ -1922,7 +1922,7 @@ BOOL WINAPI GetServiceDisplayNameA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
sizeW = *lpcchBuffer;
if (!GetServiceDisplayNameW(hSCManager, lpServiceNameW, lpDisplayNameW, &sizeW))
{
if (*lpcchBuffer && lpDisplayName)
if (lpDisplayName && *lpcchBuffer)
lpDisplayName[0] = 0;
*lpcchBuffer = sizeW*2; /* we can only provide an upper estimation of string length */
goto cleanup;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment