From 96a36fb1c4c7e04b5bf17cf07f63f2792d23f067 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:38:38 +0000 Subject: [PATCH] Fixed potential crash in frmContactEditorCalAdr 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/frmContactEditorCalAdr.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/contacteditor/frmContactEditorCalAdr.cpp b/source/contacteditor/frmContactEditorCalAdr.cpp index f690811..29da66e 100644 --- a/source/contacteditor/frmContactEditorCalAdr.cpp +++ b/source/contacteditor/frmContactEditorCalAdr.cpp @@ -213,7 +213,8 @@ void frmContactEditorCalAdr::SetEditorMode(bool EditMode) striter = CalAdrListTypePtr->find(CalAdrListIndex); - if (striter->first == CalAdrListIndex){ + if (striter->first == CalAdrListIndex && + striter != CalAdrListTypePtr->end()){ strValue = striter->second; @@ -237,7 +238,8 @@ void frmContactEditorCalAdr::SetEditorMode(bool EditMode) intiter = CalAdrListPrefPtr->find(CalAdrListIndex); - if (intiter->first == CalAdrListIndex && intiter->second > 0){ + if (intiter->first == CalAdrListIndex && intiter->second > 0 && + intiter != CalAdrListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); -- 2.39.5