msxml3: Null check newChild in DOMDocument insertBefore.

Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jefferson Carpenter 2021-05-27 12:36:46 +00:00 committed by Alexandre Julliard
parent 211da181c9
commit ec867bc428
2 changed files with 9 additions and 0 deletions

View File

@ -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;

View File

@ -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;