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

This commit is contained in:
Dan Kegel 2008-05-26 19:58:49 -07:00 committed by Alexandre Julliard
parent a4c10fda8e
commit 0161606b53
1 changed files with 2 additions and 2 deletions

View File

@ -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;