[PATCH] ole32: check FileMonikerImpl_DecomposePath return for errors (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Jan 31 05:43:19 CST 2009


Hi,

CID 555, we did not handle errors returned from DecomposePath, which
would have lead to later confusion and crashes.

Ciao, Marcus
---
 dlls/ole32/filemoniker.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c
index 0da643f..f46e631 100644
--- a/dlls/ole32/filemoniker.c
+++ b/dlls/ole32/filemoniker.c
@@ -953,12 +953,15 @@ FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** p
         IMoniker_GetDisplayName(pmkOther,pbind,NULL,&pathOther);
 
         nb1=FileMonikerImpl_DecomposePath(pathThis,&stringTable1);
+        if (FAILED(nb1)) return nb1;
         nb2=FileMonikerImpl_DecomposePath(pathOther,&stringTable2);
+        if (FAILED(nb2)) return nb2;
 
         if (nb1==0 || nb2==0)
             return MK_E_NOPREFIX;
 
         commonPath=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(min(lstrlenW(pathThis),lstrlenW(pathOther))+1));
+        if (!commonPath) return E_OUTOFMEMORY;
 
         *commonPath=0;
 
-- 
1.5.6



More information about the wine-patches mailing list