From e69c0acfe562c70333fc29bf84a13ec6a76d6fe4 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:58:03 +0000 Subject: [PATCH] Fixed potential crash with frmContactEditorNickname 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/frmContactEditorNickname.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/contacteditor/frmContactEditorNickname.cpp b/source/contacteditor/frmContactEditorNickname.cpp index 62937af..c0ecc2f 100644 --- a/source/contacteditor/frmContactEditorNickname.cpp +++ b/source/contacteditor/frmContactEditorNickname.cpp @@ -198,7 +198,8 @@ void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType striter = NicknamesListLanguagePtr->find(NicknamesListIndex); - if (striter->first == NicknamesListIndex){ + if (striter->first == NicknamesListIndex && + striter != NicknamesListLanguagePtr->end()){ strValue = striter->second; @@ -211,7 +212,8 @@ void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType intiter = NicknamesListPrefPtr->find(NicknamesListIndex); - if (intiter->first == NicknamesListIndex && intiter->second > 0){ + if (intiter->first == NicknamesListIndex && intiter->second > 0 && + intiter != NicknamesListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); -- 2.39.5