From b813f99bbcbdf103f82ece0935419a784f0f51e9 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 10 Feb 2016 01:11:23 +0000 Subject: [PATCH] Fixed potential crash with frmContactEditorTitles in Edit mode. This would be caused because no checks were made on the iterator to see if it was valid or not. --- source/contacteditor/frmContactEditorTitles.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/contacteditor/frmContactEditorTitles.cpp b/source/contacteditor/frmContactEditorTitles.cpp index 497c28e..4de0d1a 100644 --- a/source/contacteditor/frmContactEditorTitles.cpp +++ b/source/contacteditor/frmContactEditorTitles.cpp @@ -175,7 +175,8 @@ void frmContactEditorTitles::SetEditorMode(bool EditMode, SectionType SectType) striter = TitlesListPtr->find(TitlesListIndex); - if (striter->first == TitlesListIndex){ + if (striter->first == TitlesListIndex && + striter != TitlesListPtr->end()){ strValue = striter->second; @@ -189,7 +190,8 @@ void frmContactEditorTitles::SetEditorMode(bool EditMode, SectionType SectType) intiter = TitlesListPrefPtr->find(TitlesListIndex); - if (intiter->first == TitlesListIndex && intiter->second > 0){ + if (intiter->first == TitlesListIndex && intiter->second > 0 && + intiter != TitlesListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); -- 2.39.5