[PATCH] fixed wrong condition

Marcus Meissner marcus at jet.franken.de
Sat Jan 26 02:43:10 CST 2008


Hi,

Coverity spotted potential NULL dereference (CID 579),
and this is actually caused by a place where there should
be a || instead of a &&. Fixed.

Ciao, Marcus
---
 dlls/pdh/pdh_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c
index a7aa21b..d78af4a 100644
--- a/dlls/pdh/pdh_main.c
+++ b/dlls/pdh/pdh_main.c
@@ -873,7 +873,7 @@ PDH_STATUS WINAPI PdhLookupPerfNameByIndexW( LPCWSTR machine, DWORD index, LPWST
         return PDH_CSTATUS_NO_MACHINE;
     }
 
-    if (!buffer && !size) return PDH_INVALID_ARGUMENT;
+    if (!buffer || !size) return PDH_INVALID_ARGUMENT;
     if (!index) return ERROR_SUCCESS;
 
     for (i = 0; i < sizeof(counter_sources) / sizeof(counter_sources[0]); i++)
-- 
1.5.2.4



More information about the wine-patches mailing list