msxml3: Added checks for invalid arguments in queryresult.
This commit is contained in:
parent
3ac3194527
commit
212335e0b8
|
@ -118,6 +118,9 @@ static HRESULT WINAPI queryresult_QueryInterface(
|
||||||
{
|
{
|
||||||
TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
|
TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
|
||||||
|
|
||||||
|
if(!ppvObject)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if ( IsEqualGUID( riid, &IID_IUnknown ) ||
|
if ( IsEqualGUID( riid, &IID_IUnknown ) ||
|
||||||
IsEqualGUID( riid, &IID_IDispatch ) ||
|
IsEqualGUID( riid, &IID_IDispatch ) ||
|
||||||
IsEqualGUID( riid, &IID_IXMLDOMNodeList ) )
|
IsEqualGUID( riid, &IID_IXMLDOMNodeList ) )
|
||||||
|
@ -255,6 +258,9 @@ static HRESULT WINAPI queryresult_get_item(
|
||||||
|
|
||||||
TRACE("%p %ld\n", This, index);
|
TRACE("%p %ld\n", This, index);
|
||||||
|
|
||||||
|
if(!listItem)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
*listItem = NULL;
|
*listItem = NULL;
|
||||||
|
|
||||||
if (index < 0 || index >= xmlXPathNodeSetGetLength(This->result->nodesetval))
|
if (index < 0 || index >= xmlXPathNodeSetGetLength(This->result->nodesetval))
|
||||||
|
@ -274,6 +280,9 @@ static HRESULT WINAPI queryresult_get_length(
|
||||||
|
|
||||||
TRACE("%p\n", This);
|
TRACE("%p\n", This);
|
||||||
|
|
||||||
|
if(!listLength)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
*listLength = xmlXPathNodeSetGetLength(This->result->nodesetval);
|
*listLength = xmlXPathNodeSetGetLength(This->result->nodesetval);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -286,6 +295,9 @@ static HRESULT WINAPI queryresult_nextNode(
|
||||||
|
|
||||||
TRACE("%p %p\n", This, nextItem );
|
TRACE("%p %p\n", This, nextItem );
|
||||||
|
|
||||||
|
if(!nextItem)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
*nextItem = NULL;
|
*nextItem = NULL;
|
||||||
|
|
||||||
if (This->resultPos >= xmlXPathNodeSetGetLength(This->result->nodesetval))
|
if (This->resultPos >= xmlXPathNodeSetGetLength(This->result->nodesetval))
|
||||||
|
|
Loading…
Reference in New Issue