[PATCH] ole32: Access the array entry, not the array (Coverity)

Marcus Meissner marcus at jet.franken.de
Sun Jun 26 09:43:02 CDT 2011


Hi,

a real bug for once ... we write indexed entries, not overwrite
the passed array. CID 2015.

Ciao, Marcus
---
 dlls/ole32/stg_prop.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index cc29c0e..5eb0371 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -720,8 +720,8 @@ static HRESULT WINAPI IPropertyStorage_fnReadPropertyNames(
 
             hr = S_OK;
             rglpwstrName[i] = CoTaskMemAlloc((len + 1) * sizeof(WCHAR));
-            if (rglpwstrName)
-                memcpy(rglpwstrName, name, (len + 1) * sizeof(WCHAR));
+            if (rglpwstrName[i])
+                memcpy(rglpwstrName[i], name, (len + 1) * sizeof(WCHAR));
             else
                 hr = STG_E_INSUFFICIENTMEMORY;
         }
-- 
1.7.3.4




More information about the wine-patches mailing list