From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:53:47 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorKey in Edit mode. X-Git-Tag: release-0.09~27 X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=commitdiff_plain;h=fc5f22838afc80ae2e670ff478ad58bdf87fc165 Fixed potential crash with frmContactEditorKey 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/frmContactEditorKey.cpp b/source/contacteditor/frmContactEditorKey.cpp index c80642b..569b0c3 100644 --- a/source/contacteditor/frmContactEditorKey.cpp +++ b/source/contacteditor/frmContactEditorKey.cpp @@ -113,7 +113,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode) striter = KeyListDataTypePtr->find(KeyListIndex); - if (striter->first == KeyListIndex){ + if (striter->first == KeyListIndex && + striter != KeyListDataTypePtr->end()){ strValue = striter->second; @@ -152,7 +153,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode) striter = KeyListDataTypePtr->find(KeyListIndex); - if (striter->first == KeyListIndex){ + if (striter->first == KeyListIndex && + striter != KeyListDataTypePtr->end()){ strValue = striter->second; @@ -168,7 +170,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode) striter = KeyListTypePtr->find(KeyListIndex); - if (striter->first == KeyListIndex){ + if (striter->first == KeyListIndex && + striter != KeyListTypePtr->end()){ strValue = striter->second; @@ -192,7 +195,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode) intiter = KeyListPrefPtr->find(KeyListIndex); - if (intiter->first == KeyListIndex && intiter->second > 0){ + if (intiter->first == KeyListIndex && intiter->second > 0 && + intiter != KeyListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable();