dbaccess/source/core/api/OptimisticSet.cxx   |    4 +++-
 editeng/source/misc/svxacorr.cxx             |    4 +++-
 slideshow/source/engine/box2dtools.cxx       |    8 ++++++--
 svx/source/form/fmshimp.cxx                  |    3 +--
 sw/source/filter/ww8/docxattributeoutput.cxx |    4 +++-
 vcl/unx/generic/fontmanager/fontmanager.cxx  |    1 +
 6 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit b50da6f3a9109fc1d4468c15aa7d5c68773ec199
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Mon Dec 4 11:31:36 2023 +0100
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Mon Dec 4 18:00:43 2023 +0100

    cid#1546275 Using invalid iterator
    
    and :
    
    cid#1546219 Using invalid iterator
    cid#1546088 Using invalid iterator
    cid#1546070 Using invalid iterator
    cid#1546061 Using invalid iterator
    cid#1546055 Using invalid iterator
    cid#1546049 Using invalid iterator
    
    Change-Id: I6f3a786852b5c262d60c3195e446a37967ed9b59
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160311
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/dbaccess/source/core/api/OptimisticSet.cxx 
b/dbaccess/source/core/api/OptimisticSet.cxx
index d1d70955f674..2a89974794ad 100644
--- a/dbaccess/source/core/api/OptimisticSet.cxx
+++ b/dbaccess/source/core/api/OptimisticSet.cxx
@@ -353,7 +353,9 @@ void OptimisticSet::executeDelete(const ORowSetRow& 
_rDeleteRow,const OUString&
     if(m_bDeleted)
     {
         sal_Int32 nBookmark = 
::comphelper::getINT32((*_rDeleteRow)[0].getAny());
-        if(m_aKeyIter == m_aKeyMap.find(nBookmark) && m_aKeyIter != 
m_aKeyMap.end())
+        const auto iter = m_aKeyMap.find(nBookmark);
+        assert(iter != m_aKeyMap.end());
+        if(m_aKeyIter == iter && m_aKeyIter != m_aKeyMap.end())
             ++m_aKeyIter;
         m_aKeyMap.erase(nBookmark);
         m_bDeleted = true;
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 61bc805993ce..8a28ccf42ada 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2077,7 +2077,9 @@ bool SvxAutoCorrect::FindInWordStartExceptList( 
LanguageType eLang,
             CreateLanguageFile(aLanguageTag, false))
     {
         //the language is available - so bring it on
-        auto& rList = m_aLangTable.find(aLanguageTag)->second;
+        const auto iter = m_aLangTable.find(aLanguageTag);
+        assert(iter != m_aLangTable.end());
+        auto& rList = iter->second;
         if(rList.GetWordStartExceptList()->find(sWord) != 
rList.GetWordStartExceptList()->end() )
             return true;
     }
diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index 97e172a4eb4e..161bbe8c37f4 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -323,7 +323,9 @@ void box2DWorld::setShapeAngleByAngularVelocity(
     assert(mpBox2DWorld);
     if (fPassedTime > 0) // this only makes sense if there was an advance in 
time
     {
-        Box2DBodySharedPtr pBox2DBody = mpXShapeToBodyMap.find(xShape)->second;
+        const auto iter = mpXShapeToBodyMap.find(xShape);
+        assert(iter != mpXShapeToBodyMap.end());
+        Box2DBodySharedPtr pBox2DBody = iter->second;
         pBox2DBody->setAngleByAngularVelocity(fAngle, fPassedTime);
     }
 }
@@ -561,7 +563,9 @@ void box2DWorld::queueShapeAnimationEndUpdate(
 
 void box2DWorld::alertPhysicsAnimationEnd(const 
slideshow::internal::ShapeSharedPtr& pShape)
 {
-    Box2DBodySharedPtr pBox2DBody = 
mpXShapeToBodyMap.find(pShape->getXShape())->second;
+    const auto iter = mpXShapeToBodyMap.find(pShape->getXShape());
+    assert(iter != mpXShapeToBodyMap.end());
+    Box2DBodySharedPtr pBox2DBody = iter->second;
     // since the animation ended make the body static
     makeBodyStatic(pBox2DBody);
     pBox2DBody->setRestitution(fDefaultStaticBodyBounciness);
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index dd71f6999ade..a71f78f2296b 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -3380,8 +3380,7 @@ void FmXFormShell::CreateExternalView_Lock()
 
                 // value list
                 MapUString2UstringSeq::const_iterator aCurrentValueList = 
aRadioValueLists.find(rCtrlSource.first);
-                DBG_ASSERT(aCurrentValueList != aRadioValueLists.end(),
-                    "FmXFormShell::CreateExternalView : inconsistent radio 
descriptions !");
+                assert(aCurrentValueList != aRadioValueLists.end());
                 pListBoxDescription->Name = FM_PROP_STRINGITEMLIST;
                 pListBoxDescription->Value <<= (*aCurrentValueList).second;
                 ++pListBoxDescription;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8949ffe58a77..d84549d43066 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -315,7 +315,9 @@ void lclAddThemeValuesToCustomAttributes(
 
     if (rComplexColor.isValidThemeType())
     {
-        OString sSchemeType = 
constThemeColorTypeTokenMap.find(rComplexColor.getThemeColorType())->second;
+        const auto iter = 
constThemeColorTypeTokenMap.find(rComplexColor.getThemeColorType());
+        assert(iter != constThemeColorTypeTokenMap.end());
+        OString sSchemeType = iter->second;
         if (rComplexColor.getThemeColorUsage() == model::ThemeColorUsage::Text)
         {
             if (rComplexColor.getThemeColorType() == 
model::ThemeColorType::Dark1)
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx 
b/vcl/unx/generic/fontmanager/fontmanager.cxx
index c60495d5b905..a9ab5202cb05 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -728,6 +728,7 @@ FontFamily PrintFontManager::matchFamilyName( 
std::u16string_view rFamily )
 OString PrintFontManager::getFontFile(const PrintFont& rFont) const
 {
     std::unordered_map< int, OString >::const_iterator it = 
m_aAtomToDir.find(rFont.m_nDirectory);
+    assert(it != m_aAtomToDir.end());
     OString aPath = it->second + "/" + rFont.m_aFontFile;
     return aPath;
 }

Reply via email to