Alistair Leslie-Hughes : msxml3: Added checks for invalid arguments in nodelist.

Alexandre Julliard julliard at winehq.org
Thu Jul 3 06:35:45 CDT 2008


Module: wine
Branch: master
Commit: 01bd1c17c89671a3226c6a450962ecc070ef3284
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=01bd1c17c89671a3226c6a450962ecc070ef3284

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Wed Jul  2 16:16:05 2008 +1000

msxml3: Added checks for invalid arguments in nodelist.

---

 dlls/msxml3/nodelist.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/dlls/msxml3/nodelist.c b/dlls/msxml3/nodelist.c
index 79bc710..c442775 100644
--- a/dlls/msxml3/nodelist.c
+++ b/dlls/msxml3/nodelist.c
@@ -66,6 +66,9 @@ static HRESULT WINAPI xmlnodelist_QueryInterface(
 {
     TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
 
+    if(!ppvObject)
+        return E_INVALIDARG;
+
     if ( IsEqualGUID( riid, &IID_IUnknown ) ||
          IsEqualGUID( riid, &IID_IDispatch ) ||
          IsEqualGUID( riid, &IID_IXMLDOMNodeList ) )
@@ -203,7 +206,10 @@ static HRESULT WINAPI xmlnodelist_get_item(
     long nodeIndex = 0;
 
     TRACE("%p %ld\n", This, index);
- 
+
+    if(!listItem)
+        return E_INVALIDARG;
+
     *listItem = NULL;
 
     if (index < 0)
@@ -234,6 +240,9 @@ static HRESULT WINAPI xmlnodelist_get_length(
 
     TRACE("%p\n", This);
 
+    if(!listLength)
+        return E_INVALIDARG;
+
     curr = This->parent->children;
     while (curr)
     {
@@ -253,6 +262,9 @@ static HRESULT WINAPI xmlnodelist_nextNode(
 
     TRACE("%p %p\n", This, nextItem );
 
+    if(!nextItem)
+        return E_INVALIDARG;
+
     *nextItem = NULL;
 
     if (!This->current)




More information about the wine-cvs mailing list