Huw Davies : msxml3: removeChild should catch a NULL child node.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 19 04:02:28 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: a307901ac04595ade0be41ad5d6416b4a70fe31f
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=a307901ac04595ade0be41ad5d6416b4a70fe31f

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Jul 18 15:54:16 2006 +0100

msxml3: removeChild should catch a NULL child node.

---

 dlls/msxml3/node.c         |    3 +++
 dlls/msxml3/tests/domdoc.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c
index d7af878..1109a98 100644
--- a/dlls/msxml3/node.c
+++ b/dlls/msxml3/node.c
@@ -452,6 +452,9 @@ static HRESULT WINAPI xmlnode_removeChil
     TRACE("%p->(%p, %p)\n", This, childNode, oldChild);
 
     *oldChild = NULL;
+
+    if(!childNode) return E_INVALIDARG;
+
     hr = IXMLDOMNode_QueryInterface(childNode, &IID_IXMLDOMNode, (LPVOID)&child);
     if(FAILED(hr))
         return hr;
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index ecb8308..aaad036 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -1054,6 +1054,9 @@ static void test_removeChild(void)
     r = IXMLDOMNodeList_get_item( node_list, 0, &node4 );
     ok( r == S_OK, "ret %08lx\n", r);
 
+    r = IXMLDOMElement_removeChild( element, NULL, &node2 );
+    ok( r == E_INVALIDARG, "ret %08lx\n", r );
+
     r = IXMLDOMElement_removeChild( element, node4, &node2 );
     ok( r == S_OK, "ret %08lx\n", r);
     ok( node4 == node2, "node %p node2 %p\n", node4, node2 );




More information about the wine-cvs mailing list