Commit ba018b52 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3/saxreader: Handle NULL interface input in parse().

parent a5031391
......@@ -2664,6 +2664,9 @@ static HRESULT internal_parse(
ISequentialStream *stream = NULL;
IXMLDOMDocument *xmlDoc;
if (!V_UNKNOWN(&varInput))
return E_INVALIDARG;
if(IUnknown_QueryInterface(V_UNKNOWN(&varInput),
&IID_IXMLDOMDocument, (void**)&xmlDoc) == S_OK)
{
......
......@@ -2221,6 +2221,16 @@ static void test_saxreader(void)
SafeArrayDestroy(sa);
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = NULL;
hr = ISAXXMLReader_parse(reader, var);
ok(hr == E_INVALIDARG, "got %#x\n", hr);
V_VT(&var) = VT_DISPATCH;
V_DISPATCH(&var) = NULL;
hr = ISAXXMLReader_parse(reader, var);
ok(hr == E_INVALIDARG, "got %#x\n", hr);
stream = create_test_stream(testXML, -1);
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)stream;
......
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