diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-06-03 14:07:39 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2020-06-03 20:27:07 +0200 |
commit | b062daefa9efe63b0c5be395ae6fc3aecc25259a (patch) | |
tree | 5efd0d0104be8a9b0aa04b20b58fddbe728b47fa /winaccessibility | |
parent | 38f91bb2ced2eb3685229a05120308cd0c213ebc (diff) |
tdf#133633 winaccessibility: Add null check
The call to 'AccObjectManagerAgent::GetIAccessibleFromResID'
may set 'pImAcc' to nullptr here (s.
'AccObjectWinManager::GetIAccessibleFromResID', which is called
from there), so handle that case gracefully.
Change-Id: I0dbd48974fd012ff086835b147cd9b9cfc8a052b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95430
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit cb55b2854de31004ab1d0277894f9f2581d5c31b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95418
Diffstat (limited to 'winaccessibility')
-rw-r--r-- | winaccessibility/source/UAccCOM/MAccessible.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index c691f604faac..413999b35fab 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -790,6 +790,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accFocus(VARIANT *pvarChild) { IMAccessible* pIMAcc = nullptr; g_pAgent->GetIAccessibleFromResID(m_dFocusChildID,&pIMAcc); + if (pIMAcc == nullptr) + { + return E_FAIL; + } pIMAcc->AddRef(); pvarChild->vt = VT_DISPATCH; pvarChild->pdispVal = pIMAcc; |