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:
parent
211da181c9
commit
ec867bc428
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue