From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:38:38 +0000 (+0000) Subject: Fixed potential crash in frmContactEditorCalAdr in Edit mode. X-Git-Tag: release-0.09~32 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=96a36fb1c4c7e04b5bf17cf07f63f2792d23f067;p=xestiaab%2F.git 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. --- 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();