Commit ec867bc4 authored by Jefferson Carpenter's avatar Jefferson Carpenter Committed by Alexandre Julliard

msxml3: Null check newChild in DOMDocument insertBefore.

parent 211da181
......@@ -1210,6 +1210,8 @@ static HRESULT WINAPI domdoc_insertBefore(
TRACE("(%p)->(%p %s %p)\n", This, newChild, debugstr_variant(&refChild), outNewChild);
if (!newChild) return E_INVALIDARG;
hr = IXMLDOMNode_get_nodeType(newChild, &type);
if (hr != S_OK) return hr;
......
......@@ -9235,6 +9235,13 @@ static void test_insertBefore(void)
doc = create_document(&IID_IXMLDOMDocument);
doc3 = create_document(&IID_IXMLDOMDocument);
/* NULL to document */
V_VT(&v) = VT_NULL;
node = (void*)0xdeadbeef;
hr = IXMLDOMDocument_insertBefore(doc, NULL, v, &node);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(node == (void*)0xdeadbeef, "got %p\n", node);
/* document to document */
V_VT(&v) = VT_NULL;
node = (void*)0xdeadbeef;
......
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