sw/source/core/doc/doclay.cxx | 6 ++++-- sw/source/filter/xml/xmltble.cxx | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-)
New commits: commit a902f5c5a269621139c933ad50e2b178bf764df3 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Jun 13 08:54:44 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Jun 13 15:01:03 2024 +0200 cid#1603615 silence Using invalid iterator and cid#1603624 Using invalid iterator Change-Id: I9a067b92feb57771eaa1743646113b026753a410 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168770 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index c55fe48ce839..fe13cb0660d8 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -289,7 +289,9 @@ public: continue; // found! - auto const oName(m_rFormatMap.find(pTestFormat)->second); + auto const oNameIt(m_rFormatMap.find(pTestFormat)); + assert(oNameIt != m_rFormatMap.end()); + auto const oName(oNameIt->second); assert(oName); m_rFormatMap.try_emplace(&rFrameFormat, oName); return {}; @@ -480,7 +482,9 @@ static OUString lcl_xmltble_appendBoxPrefix(std::u16string_view rNamePrefix, continue; // found! - auto const oName(m_rFormatMap.find(pTestFormat)->second); + auto const oNameIt(m_rFormatMap.find(pTestFormat)); + assert(oNameIt != m_rFormatMap.end()); + auto const oName(oNameIt->second); assert(oName); m_rFormatMap.try_emplace(&rFrameFormat, oName); return {}; commit b04a6494cdf462266333c23ebc943ceca40c20cf Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Jun 13 08:51:32 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Jun 13 15:00:52 2024 +0200 cid#1603626 silence Dereference null return value Change-Id: I2da354ffc2ed28df1744bad7762413431b894f59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168769 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 611c1a862a15..26431d2df24c 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -208,8 +208,10 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, SwFormatAnchor aAnch( pFormat->GetAnchor() ); if (pAnchor && (RndStdIds::FLY_AT_FLY == pAnchor->GetAnchorId())) { - SwPosition aPos( *rAnchPos.GetNode().FindFlyStartNode() ); - aAnch.SetAnchor( &aPos ); + const SwNode* pFlyStartNode = rAnchPos.GetNode().FindFlyStartNode(); + assert(pFlyStartNode); + SwPosition aPos(*pFlyStartNode); + aAnch.SetAnchor(&aPos); eAnchorId = RndStdIds::FLY_AT_FLY; } else