Alistair Leslie-Hughes : advapi32: Don' t read a value that might be uninitialized (Coverity).

Alexandre Julliard julliard at winehq.org
Mon Jun 17 15:54:21 CDT 2019


Module: wine
Branch: master
Commit: 1b714ca0886aed265f85f6a661e3058f9f7c56a1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1b714ca0886aed265f85f6a661e3058f9f7c56a1

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Mon Jun 17 06:28:43 2019 +0000

advapi32: Don't read a value that might be uninitialized (Coverity).

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/advapi32/registry.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 9269898..2d2c1be 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -2118,7 +2118,7 @@ LSTATUS WINAPI RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue,
                           DWORD dwFlags, LPDWORD pdwType, PVOID pvData,
                           LPDWORD pcbData )
 {
-    DWORD dwType, cbData = pcbData ? *pcbData : 0;
+    DWORD dwType, cbData = (pvData && pcbData) ? *pcbData : 0;
     PVOID pvBuf = NULL;
     LONG ret;
 
@@ -2214,7 +2214,7 @@ LSTATUS WINAPI RegGetValueA( HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue,
                           DWORD dwFlags, LPDWORD pdwType, PVOID pvData, 
                           LPDWORD pcbData )
 {
-    DWORD dwType, cbData = pcbData ? *pcbData : 0;
+    DWORD dwType, cbData = (pvData && pcbData) ? *pcbData : 0;
     PVOID pvBuf = NULL;
     LONG ret;
 




More information about the wine-cvs mailing list