Commit 13d95525 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Protect from null pointer in load().

parent 39562961
...@@ -2093,6 +2093,7 @@ static HRESULT WINAPI domdoc_load( ...@@ -2093,6 +2093,7 @@ static HRESULT WINAPI domdoc_load(
} }
break; break;
case VT_UNKNOWN: case VT_UNKNOWN:
if (!V_UNKNOWN(&source)) return E_INVALIDARG;
hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_IXMLDOMDocument3, (void**)&pNewDoc); hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_IXMLDOMDocument3, (void**)&pNewDoc);
if(hr == S_OK) if(hr == S_OK)
{ {
......
...@@ -10749,6 +10749,13 @@ static void test_load(void) ...@@ -10749,6 +10749,13 @@ static void test_load(void)
doc = create_document(&IID_IXMLDOMDocument); doc = create_document(&IID_IXMLDOMDocument);
/* null pointer as input */
V_VT(&src) = VT_UNKNOWN;
V_UNKNOWN(&src) = NULL;
hr = IXMLDOMDocument_load(doc, src, &b);
EXPECT_HR(hr, E_INVALIDARG);
ok(b == VARIANT_FALSE, "got %d\n", b);
path = _bstr_("test.xml"); path = _bstr_("test.xml");
/* load from path: VT_BSTR */ /* load from path: VT_BSTR */
......
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