From 45df1265cf7e9107ce5efac410b1251e92d7018c Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 10 Feb 2016 00:02:39 +0000 Subject: [PATCH] Fixed potential crash with frmContactEditorNotes 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/frmContactEditorNotes.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/contacteditor/frmContactEditorNotes.cpp b/source/contacteditor/frmContactEditorNotes.cpp index 0dbfb78..e07687a 100644 --- a/source/contacteditor/frmContactEditorNotes.cpp +++ b/source/contacteditor/frmContactEditorNotes.cpp @@ -220,7 +220,8 @@ void frmContactEditorNotes::SetEditorMode(bool EditMode, SectionType SectType) striter = NotesListLangPtr->find(NotesListIndex); - if (striter->first == NotesListIndex){ + if (striter->first == NotesListIndex && + striter != NotesListLangPtr->end()){ strValue = striter->second; @@ -232,7 +233,8 @@ void frmContactEditorNotes::SetEditorMode(bool EditMode, SectionType SectType) intiter = NotesListPrefPtr->find(NotesListIndex); - if (intiter->first == NotesListIndex && intiter->second > 0){ + if (intiter->first == NotesListIndex && intiter->second > 0 && + intiter != NotesListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); -- 2.39.2