Commit 1ed0631e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

xmllite/reader: Handle NULL argument in GetNodeType().

parent 5e59d093
......@@ -2786,8 +2786,12 @@ static HRESULT WINAPI xmlreader_Read(IXmlReader* iface, XmlNodeType *nodetype)
static HRESULT WINAPI xmlreader_GetNodeType(IXmlReader* iface, XmlNodeType *node_type)
{
xmlreader *This = impl_from_IXmlReader(iface);
TRACE("(%p)->(%p)\n", This, node_type);
if (!node_type)
return E_INVALIDARG;
*node_type = reader_get_nodetype(This);
return This->state == XmlReadState_Closed ? S_FALSE : S_OK;
}
......
......@@ -427,6 +427,13 @@ static void test_reader_create(void)
ok(hr == S_FALSE, "got %08x\n", hr);
ok(nodetype == XmlNodeType_None, "got %d\n", nodetype);
/* crashes on XP, 2k3, works on newer versions */
if (0)
{
hr = IXmlReader_GetNodeType(reader, NULL);
ok(hr == E_INVALIDARG, "got %08x\n", hr);
}
resolver = (void*)0xdeadbeef;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR*)&resolver);
ok(hr == S_OK, "got 0x%08x\n", hr);
......
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