oleaut32 - GetTypeInfoType - Return TYPE_E_ELEMENTNOTFOUND if index out of bounds

Stefan Siebert stefan.siebert at web.de
Thu Aug 3 10:54:06 CDT 2006


MSDN states that if the index for GetTypeInfoType is outside the range 
of 0 to GetTypeInfoCount() - 1, than it should return 
TYPE_E_ELEMENTNOTFOUND.

Also the Notes Clients (Designer) builtin Ole Viewer won't crash anymore 
with this patch.

Changelog: oleaut32/typelib.c - GetTypeInfoType - Return 
TYPE_E_ELEMENTNOTFOUND if index out of bounds

- Stefan Siebert

-------------- next part --------------
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
old mode 100644
new mode 100755
index e648735..d75b665
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -3602,6 +3602,9 @@ static HRESULT WINAPI ITypeLib2_fnGetTyp
     ITypeLibImpl *This = (ITypeLibImpl *)iface;
     int i;
     ITypeInfoImpl *pTInfo = This->pTypeInfo;
+    
+    if ((ITypeLib2_fnGetTypeInfoCount(iface) < index + 1) || (index < 0))
+    	 return TYPE_E_ELEMENTNOTFOUND;
 
     TRACE("(%p) index %d\n", This, index);
 


More information about the wine-patches mailing list