[Libreoffice-commits] core.git: Branch 'libreoffice-4-2-0' - 2 commits - winaccessibility/source

Michael Meeks michael.meeks at collabora.com
Mon Jan 27 04:26:04 PST 2014


 winaccessibility/source/UAccCOM/MAccessible.cxx |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

New commits:
commit 37bb1d0d8032eb859322d7d3c60f8799e48250a0
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Mon Jan 27 12:08:55 2014 +0000

    fdo#73464 - guard against NULL / unset m_xAccessible.
    
    Change-Id: I3351acf18d334447336ee98761190fdff32d5b85
    Reviewed-on: https://gerrit.libreoffice.org/7692
    Reviewed-by: David Ostrovsky <David.Ostrovsky at gmx.de>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 5fb1172..6ed3c4e 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -1434,6 +1434,9 @@ IMAccessible* CMAccessible::GetChildInterface(long dChildID)//for test
     }
     else
     {
+        if (!m_xAccessible.is())
+            return NULL;
+
         Reference<XAccessibleContext> const pRContext =
             m_xAccessible->getAccessibleContext();
         if( !pRContext.is() )
@@ -1948,6 +1951,9 @@ STDMETHODIMP CMAccessible:: get_groupPosition(long __RPC_FAR *groupLevel,long __
             return E_INVALIDARG;
         }
 
+        if (!m_xAccessible.is())
+            return E_FAIL;
+
         Reference<XAccessibleContext> const pRContext =
             m_xAccessible->getAccessibleContext();
         if(!pRContext.is())
@@ -3316,6 +3322,9 @@ STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *pAttr)
     ENTER_PROTECTED_BLOCK
     ISDESTROY()
 
+    if (!m_xAccessible.is())
+        return E_FAIL;
+
     Reference<XAccessibleContext> pRContext = m_xAccessible->getAccessibleContext();
     if( !pRContext.is() )
     {
commit 7fc75233d5db5ee43f71299a56e06e40ff5c529f
Author: Steve Yin <steve_y at apache.org>
Date:   Mon Jan 27 05:49:26 2014 +0000

    Resolves: #i124095# Multiple IAccessible and IAccessible2...
    
    interface methods do not check for NULL pointer access, nor do they trap
    exceptions
    
    Fixed by Michael Curran
    (cherry picked from commit 113171f2a5d726af6c5266e98e8e790ac6729d2d)
    
    Conflicts:
    	winaccessibility/source/UAccCOM/MAccessible.cxx
    
    Change-Id: I28d4b885a6c2db487c2754c2ca11290b3844570b
    Reviewed-on: https://gerrit.libreoffice.org/7691
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 4da2165..5fb1172 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -378,8 +378,8 @@ STDMETHODIMP CMAccessible::get_accChild(VARIANT varChild, IDispatch **ppdispChil
                 return S_OK;
             }
             *ppdispChild = GetChildInterface(varChild.lVal);
-            if (!(*ppdispChild))
-                return S_FALSE;
+            if((*ppdispChild) == NULL)
+                return E_FAIL;
             (*ppdispChild)->AddRef();
             return S_OK;
         }
@@ -1709,6 +1709,7 @@ STDMETHODIMP CMAccessible::get_nRelations( long __RPC_FAR *nRelations)
     SolarMutexGuard g;
 
         ENTER_PROTECTED_BLOCK
+        ISDESTROY()
 
         // #CHECK#
         if(nRelations == NULL)
@@ -1802,6 +1803,7 @@ STDMETHODIMP CMAccessible::get_relations( long, IAccessibleRelation __RPC_FAR *_
     SolarMutexGuard g;
 
         ENTER_PROTECTED_BLOCK
+        ISDESTROY()
 
         // #CHECK#
         if(relation == NULL || nRelations == NULL)
@@ -3311,6 +3313,9 @@ STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *pAttr)
 {
     SolarMutexGuard g;
 
+    ENTER_PROTECTED_BLOCK
+    ISDESTROY()
+
     Reference<XAccessibleContext> pRContext = m_xAccessible->getAccessibleContext();
     if( !pRContext.is() )
     {
@@ -3334,6 +3339,7 @@ STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *pAttr)
 
         return S_OK;
     }
+    LEAVE_PROTECTED_BLOCK
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list