Piotr Caban : msxml3: Add NULL pointers check in getLocalName, getQName and getValue.

Alexandre Julliard julliard at winehq.org
Mon Aug 4 08:53:42 CDT 2008


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

Author: Piotr Caban <piotr.caban at gmail.com>
Date:   Sun Aug  3 14:37:45 2008 +0200

msxml3: Add NULL pointers check in getLocalName, getQName and getValue.

---

 dlls/msxml3/saxreader.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c
index b87576a..b4e25f2 100644
--- a/dlls/msxml3/saxreader.c
+++ b/dlls/msxml3/saxreader.c
@@ -626,7 +626,8 @@ static HRESULT WINAPI isaxattributes_getLocalName(
     saxattributes *This = impl_from_ISAXAttributes( iface );
     TRACE("(%p)->(%d)\n", This, nIndex);
 
-    if(nIndex >= This->nb_attributes) return E_INVALIDARG;
+    if(nIndex>=This->nb_attributes || nIndex<0) return E_INVALIDARG;
+    if(!pLocalName || !pLocalNameLength) return E_POINTER;
 
     *pLocalNameLength = SysStringLen(This->szLocalname[nIndex]);
     *pLocalName = This->szLocalname[nIndex];
@@ -643,7 +644,8 @@ static HRESULT WINAPI isaxattributes_getQName(
     saxattributes *This = impl_from_ISAXAttributes( iface );
     TRACE("(%p)->(%d)\n", This, nIndex);
 
-    if(nIndex >= This->nb_attributes) return E_INVALIDARG;
+    if(nIndex>=This->nb_attributes || nIndex<0) return E_INVALIDARG;
+    if(!pQName || !pQNameLength) return E_POINTER;
 
     *pQNameLength = SysStringLen(This->szQName[nIndex]);
     *pQName = This->szQName[nIndex];
@@ -744,7 +746,8 @@ static HRESULT WINAPI isaxattributes_getValue(
     saxattributes *This = impl_from_ISAXAttributes( iface );
     TRACE("(%p)->(%d)\n", This, nIndex);
 
-    if(nIndex >= This->nb_attributes) return E_INVALIDARG;
+    if(nIndex>=This->nb_attributes || nIndex<0) return E_INVALIDARG;
+    if(!pValue || !nValue) return E_POINTER;
 
     *nValue = SysStringLen(This->szValue[nIndex]);
     *pValue = This->szValue[nIndex];




More information about the wine-cvs mailing list