From 7db43aa6a639f5fe6004340959b39f7e57826854 Mon Sep 17 00:00:00 2001 From: Mike Nordell Date: Sat, 15 Sep 2012 21:41:46 +0000 Subject: [PATCH] Fix crash in xmlnodelist_QueryInterface. Solves CORE-6665. svn path=/trunk/; revision=57310 --- reactos/dll/win32/msxml3/msxml3_ros.diff | 18 ++++++++++++++++++ reactos/dll/win32/msxml3/nodelist.c | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/reactos/dll/win32/msxml3/msxml3_ros.diff b/reactos/dll/win32/msxml3/msxml3_ros.diff index 2078a1712b6..ed356fa7125 100644 --- a/reactos/dll/win32/msxml3/msxml3_ros.diff +++ b/reactos/dll/win32/msxml3/msxml3_ros.diff @@ -20,3 +20,21 @@ Index: msxml3.spec @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) + + +Index: nodelist.c +=================================================================== +--- nodelist.c (revision 57307) ++++ nodelist.c (working copy) +@@ -87,6 +87,11 @@ + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject); + ++ if (!ppvObject) ++ { ++ return E_POINTER; ++ } ++ + if ( IsEqualGUID( riid, &IID_IUnknown ) || + IsEqualGUID( riid, &IID_IDispatch ) || + IsEqualGUID( riid, &IID_IXMLDOMNodeList ) ) diff --git a/reactos/dll/win32/msxml3/nodelist.c b/reactos/dll/win32/msxml3/nodelist.c index 756783df7af..f39546c884a 100644 --- a/reactos/dll/win32/msxml3/nodelist.c +++ b/reactos/dll/win32/msxml3/nodelist.c @@ -87,6 +87,11 @@ static HRESULT WINAPI xmlnodelist_QueryInterface( TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject); + if (!ppvObject) + { + return E_POINTER; + } + if ( IsEqualGUID( riid, &IID_IUnknown ) || IsEqualGUID( riid, &IID_IDispatch ) || IsEqualGUID( riid, &IID_IXMLDOMNodeList ) )