[Libreoffice-commits] core.git: Branch 'aoo/trunk' - winaccessibility/source

Steve Yin steve_y at apache.org
Sun Jan 26 22:07:22 PST 2014


 winaccessibility/source/UAccCOM/MAccessible.cpp |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 113171f2a5d726af6c5266e98e8e790ac6729d2d
Author: Steve Yin <steve_y at apache.org>
Date:   Mon Jan 27 05:49:26 2014 +0000

    Bug 124095 - Multiple IAccessible and IAccessible2 interface methods do not check for NULL pointer access, nor do they trap exceptions
    
    Fixed by Michael Curran

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cpp b/winaccessibility/source/UAccCOM/MAccessible.cpp
index 943fb40..b352068 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cpp
+++ b/winaccessibility/source/UAccCOM/MAccessible.cpp
@@ -353,8 +353,10 @@ STDMETHODIMP CMAccessible::get_accChild(VARIANT varChild, IDispatch **ppdispChil
                 return S_OK;
             }
             *ppdispChild = GetChildInterface(varChild.lVal);
+            if((*ppdispChild) == NULL)
+                return E_FAIL;
             (*ppdispChild)->AddRef();
-            return (*ppdispChild)?S_OK:S_FALSE;
+            return S_OK;
         }
         return S_FALSE;
 
@@ -1653,6 +1655,7 @@ STDMETHODIMP CMAccessible::get_nRelations( long __RPC_FAR *nRelations)
 
     CHECK_ENABLE_INF
         ENTER_PROTECTED_BLOCK
+        ISDESTROY()
 
         // #CHECK#
         if(nRelations == NULL)
@@ -1748,6 +1751,7 @@ STDMETHODIMP CMAccessible::get_relations( long, IAccessibleRelation __RPC_FAR *_
 
     CHECK_ENABLE_INF
         ENTER_PROTECTED_BLOCK
+        ISDESTROY()
 
         // #CHECK#
         if(relation == NULL || nRelations == NULL)
@@ -3240,6 +3244,8 @@ STDMETHODIMP CMAccessible:: get_toolkitVersion(BSTR __RPC_FAR *version)
 
 STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *pAttr)
 {
+    ENTER_PROTECTED_BLOCK
+    ISDESTROY()
     CHECK_ENABLE_INF
         Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
     if( !pRContext.is() )
@@ -3264,5 +3270,6 @@ STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *pAttr)
 
         return S_OK;
     }
+    LEAVE_PROTECTED_BLOCK
 }
 


More information about the Libreoffice-commits mailing list