Commit 212335e0 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: Added checks for invalid arguments in queryresult.

parent 3ac31945
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment