Commit 653504a3 authored by Jefferson Carpenter's avatar Jefferson Carpenter Committed by Alexandre Julliard

msxml3: Null check newNode in domelem insertBefore.

parent ec867bc4
......@@ -309,6 +309,8 @@ static HRESULT WINAPI domelem_insertBefore(
TRACE("(%p)->(%p %s %p)\n", This, newNode, debugstr_variant(&refChild), old_node);
if (!newNode) return E_INVALIDARG;
hr = IXMLDOMNode_get_nodeType(newNode, &type);
if (hr != S_OK) return hr;
......
......@@ -9411,6 +9411,13 @@ static void test_insertBefore(void)
todo_wine EXPECT_REF(elem2, 2);
/* NULL to element */
V_VT(&v) = VT_NULL;
node = (void*)0xdeadbeef;
hr = IXMLDOMElement_insertBefore(elem1, NULL, v, &node);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(node == (void*)0xdeadbeef, "got %p\n", node);
/* document to element */
V_VT(&v) = VT_DISPATCH;
V_DISPATCH(&v) = NULL;
......
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