summaryrefslogtreecommitdiff
path: root/winaccessibility/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-05 19:10:50 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-06 12:23:19 +0200
commit09c7447e27fcf4b28b51403273b542713006aac8 (patch)
tree3aa747e9fd56913abe6887cf1032011616793350 /winaccessibility/source
parent76d762fea934df31cd81768d467d5d40d439cb67 (diff)
WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: I9659627ce90d6e23bbb3c27e01c365f1167b39ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167171 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'winaccessibility/source')
-rw-r--r--winaccessibility/source/UAccCOM/AccActionBase.cxx3
-rw-r--r--winaccessibility/source/UAccCOM/AccTable.cxx2
-rw-r--r--winaccessibility/source/UAccCOM/AccTableCell.cxx2
3 files changed, 6 insertions, 1 deletions
diff --git a/winaccessibility/source/UAccCOM/AccActionBase.cxx b/winaccessibility/source/UAccCOM/AccActionBase.cxx
index 0fb2d7bbcee6..0b7a652cef9f 100644
--- a/winaccessibility/source/UAccCOM/AccActionBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccActionBase.cxx
@@ -65,7 +65,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccActionBase::nActions(/*[out,retval]*/long*
*nActions = pRXAct->getAccessibleActionCount();
return S_OK;
}
- *nActions = 0;
+ if( nActions != nullptr )
+ *nActions = 0;
return S_OK;
diff --git a/winaccessibility/source/UAccCOM/AccTable.cxx b/winaccessibility/source/UAccCOM/AccTable.cxx
index a158cf70667f..409db86273de 100644
--- a/winaccessibility/source/UAccCOM/AccTable.cxx
+++ b/winaccessibility/source/UAccCOM/AccTable.cxx
@@ -987,6 +987,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedChildren(long, long **c
*nChildren = nChildCount;
*children = static_cast<long*>(CoTaskMemAlloc(nChildCount * sizeof(long)));
+ assert(*children && "Don't handle OOM conditions");
for( sal_Int64 i = 0; i< nChildCount; i++)
{
@@ -1049,6 +1050,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedCells(IUnknown * * * ce
*nSelectedCells = nSelected;
*cells = static_cast<IUnknown**>(CoTaskMemAlloc(nSelected * sizeof(IUnknown*)));
+ assert(*cells && "Don't handle OOM conditions");
for (sal_Int64 i = 0; i < nSelected; i++)
{
diff --git a/winaccessibility/source/UAccCOM/AccTableCell.cxx b/winaccessibility/source/UAccCOM/AccTableCell.cxx
index 95725c2a4042..db6bc32fbbe9 100644
--- a/winaccessibility/source/UAccCOM/AccTableCell.cxx
+++ b/winaccessibility/source/UAccCOM/AccTableCell.cxx
@@ -109,6 +109,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::get_columnHeaderCells(IUnknown*
const sal_Int32 nCount = xHeaders->getAccessibleRowCount();
*pColumnHeaderCellCount = nCount;
*cellAccessibles = static_cast<IUnknown**>(CoTaskMemAlloc(nCount * sizeof(IUnknown*)));
+ assert(*cellAccessibles && "Don't handle OOM conditions");
sal_Int32 nCol = 0;
get_columnIndex(&nCol);
for (sal_Int32 nRow = 0; nRow < nCount; nRow++)
@@ -196,6 +197,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::get_rowHeaderCells(IUnknown***
const sal_Int32 nCount = xHeaders->getAccessibleColumnCount();
*pRowHeaderCellCount = nCount;
*cellAccessibles = static_cast<IUnknown**>(CoTaskMemAlloc(nCount * sizeof(IUnknown*)));
+ assert(*cellAccessibles && "Don't handle OOM conditions");
sal_Int32 nRow = 0;
get_rowIndex(&nRow);
for (sal_Int32 nCol = 0; nCol < nCount; nCol++)