Dan Kegel : advapi32: Don't test buffer length if buffer is null.
Alexandre Julliard
julliard at winehq.org
Wed May 28 04:56:54 CDT 2008
Module: wine
Branch: master
Commit: 0161606b538c69ad6207b7adab867d0896adc04b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0161606b538c69ad6207b7adab867d0896adc04b
Author: Dan Kegel <dank at kegel.com>
Date: Mon May 26 19:58:49 2008 -0700
advapi32: Don't test buffer length if buffer is null.
---
dlls/advapi32/service.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c
index fc5be79..c04eb8c 100644
--- a/dlls/advapi32/service.c
+++ b/dlls/advapi32/service.c
@@ -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;
More information about the wine-cvs
mailing list