From 7a5a7819f86205ae16e7dd284a2fb3e853181e5a Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Sun, 3 Aug 2008 14:37:45 +0200 Subject: [PATCH] msxml3: Add NULL pointers check in getLocalName, getQName and getValue. --- dlls/msxml3/saxreader.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index b87576a6a02..b4e25f24d3d 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];