sw/source/filter/ww8/ww8par.cxx | 8 ++++++-- sw/source/ui/index/swuiidxmrk.cxx | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-)
New commits: commit 80c0625995585a43f8dd4cbc7404df47f62dfae9 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Mar 4 14:59:41 2022 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Mar 4 22:35:39 2022 +0100 cid#1500652 silence Explicit null dereferenced Change-Id: Ifb96f7cf3d28b3bef70c8d920d8c926c76329fb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130995 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index fb5ae141563c..02e9f20454c0 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1719,6 +1719,7 @@ SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(weld::Window* pParent, ++nRightRow; bLeft = !bLeft; } + assert(m_xTypeListBox && "this will exist after the loop"); EnableHdl(*m_xTypeListBox); } @@ -1726,13 +1727,13 @@ OUString SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) cons { if( AUTH_FIELD_AUTHORITY_TYPE == eField ) { - OSL_ENSURE(m_xTypeListBox, "No ListBox"); + assert(m_xTypeListBox && "No ListBox"); return OUString::number(m_xTypeListBox->get_active()); } if( AUTH_FIELD_IDENTIFIER == eField && !m_bNewEntryMode) { - OSL_ENSURE(m_xIdentifierBox, "No ComboBox"); + assert(m_xIdentifierBox && "No ComboBox"); return m_xIdentifierBox->get_active_text(); } commit 6b566ed9a32c5c0eb3bde7512733c0c11a479ecd Author: Caolán McNamara <[email protected]> AuthorDate: Fri Mar 4 14:55:22 2022 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Mar 4 22:35:25 2022 +0100 cid#1500666 Explicit null dereferenced Change-Id: Id4283660feb95432995872b82e71c3331349f837 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130994 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 6614c5195f28..469118b61ebd 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -280,7 +280,9 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell const * pDocS // ANSI characters in ansiPath, including the terminating NULL character sal_uInt32 nUnits = 0; rStrm.ReadUInt32(nUnits); - if (nUnits) + if (!nUnits) + xShortName.reset(new OUString); + else { OString sStr(read_uInt8s_ToOString(rStrm, nUnits - 1)); rStrm.SeekRel(sizeof(sal_uInt8)); // skip null-byte at end @@ -312,7 +314,9 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell const * pDocS sal_uInt32 nStrLen(0); rStrm.ReadUInt32( nStrLen ); nStrLen /= 2; - if (nStrLen) + if (!nStrLen) + xLongName.reset(new OUString); + else { xLongName.reset(new OUString(read_uInt16s_ToOUString(rStrm, nStrLen - 1))); rStrm.SeekRel(sizeof(sal_Unicode)); // skip null-byte at end
