msxml3: Protect from null pointer in load().

This commit is contained in:
Nikolay Sivov 2012-07-14 22:52:35 +04:00 committed by Alexandre Julliard
parent 3956296128
commit 13d95525c3
2 changed files with 8 additions and 0 deletions

View File

@ -2093,6 +2093,7 @@ static HRESULT WINAPI domdoc_load(
}
break;
case VT_UNKNOWN:
if (!V_UNKNOWN(&source)) return E_INVALIDARG;
hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_IXMLDOMDocument3, (void**)&pNewDoc);
if(hr == S_OK)
{

View File

@ -10749,6 +10749,13 @@ static void test_load(void)
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");
/* load from path: VT_BSTR */