Module: wine Branch: refs/heads/master Commit: 9776f5b83fbd30733b1a1f8598f67311c4f50cfc URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=9776f5b83fbd30733b1a1f85...
Author: Stefan Siebert stefan.siebert@web.de Date: Thu Aug 3 17:54:06 2006 +0200
oleaut32: GetTypeInfoType - Return TYPE_E_ELEMENTNOTFOUND if index out of bounds.
---
dlls/oleaut32/typelib.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index e648735..d75b665 100644 --- 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);