From 296baaf67d5aef9ed8e57f9de85a3d16ea86d767 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:43:47 +0000 Subject: [PATCH] Fixed potential crash with frmContactEditorEmail 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/frmContactEditorEmail.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/contacteditor/frmContactEditorEmail.cpp b/source/contacteditor/frmContactEditorEmail.cpp index 2830a65..407b63b 100644 --- a/source/contacteditor/frmContactEditorEmail.cpp +++ b/source/contacteditor/frmContactEditorEmail.cpp @@ -188,13 +188,14 @@ void frmContactEditorEmail::SetEditorMode(bool EditMode, SectionType SectType) intiter = EmailListPrefPtr->find(EmailListIndex); - if (intiter->first == EmailListIndex && intiter->second > 0){ + if (intiter->first == EmailListIndex && intiter->second > 0 && + intiter != EmailListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); chkUsePref->SetValue(TRUE); - } + } } -- 2.39.2