[PATCH] oleaut32: check a return value (Coverity)

Marcus Meissner meissner at suse.de
Tue Jul 2 08:45:04 CDT 2013


 1040357 Unchecked return value

Might have actually caused *ppsa to be used uninitialized.

Ciao, Marcus
---
 dlls/oleaut32/usrmarshal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/oleaut32/usrmarshal.c b/dlls/oleaut32/usrmarshal.c
index 495c257..a434ec0 100644
--- a/dlls/oleaut32/usrmarshal.c
+++ b/dlls/oleaut32/usrmarshal.c
@@ -1073,7 +1073,8 @@ unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(ULONG *pFlags, unsigned char *B
         *ppsa = SafeArrayCreateEx(vt, wiresa->cDims, wiresab, NULL);
     else
     {
-        SafeArrayAllocDescriptor(wiresa->cDims, ppsa);
+        if (FAILED(SafeArrayAllocDescriptor(wiresa->cDims, ppsa)))
+            RpcRaiseException(E_OUTOFMEMORY);
         if(*ppsa)
             memcpy((*ppsa)->rgsabound, wiresab, sizeof(SAFEARRAYBOUND) * wiresa->cDims);
     }
-- 
1.8.1.4




More information about the wine-patches mailing list