msxml3: Added checks for invalid arguments in queryresult.

This commit is contained in:
Alistair Leslie-Hughes 2008-07-02 16:15:55 +10:00 committed by Alexandre Julliard
parent 3ac3194527
commit 212335e0b8
1 changed files with 12 additions and 0 deletions

View File

@ -118,6 +118,9 @@ static HRESULT WINAPI queryresult_QueryInterface(
{
TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
if(!ppvObject)
return E_INVALIDARG;
if ( IsEqualGUID( riid, &IID_IUnknown ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
IsEqualGUID( riid, &IID_IXMLDOMNodeList ) )
@ -255,6 +258,9 @@ static HRESULT WINAPI queryresult_get_item(
TRACE("%p %ld\n", This, index);
if(!listItem)
return E_INVALIDARG;
*listItem = NULL;
if (index < 0 || index >= xmlXPathNodeSetGetLength(This->result->nodesetval))
@ -274,6 +280,9 @@ static HRESULT WINAPI queryresult_get_length(
TRACE("%p\n", This);
if(!listLength)
return E_INVALIDARG;
*listLength = xmlXPathNodeSetGetLength(This->result->nodesetval);
return S_OK;
}
@ -286,6 +295,9 @@ static HRESULT WINAPI queryresult_nextNode(
TRACE("%p %p\n", This, nextItem );
if(!nextItem)
return E_INVALIDARG;
*nextItem = NULL;
if (This->resultPos >= xmlXPathNodeSetGetLength(This->result->nodesetval))