From c652fc6a8c7adb87cd00a96548d2f6275842f9f8 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 9 Feb 2016 23:42:02 +0000 Subject: [PATCH] Fixed potential crash with frmContactEditorCategory 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/frmContactEditorCategory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/contacteditor/frmContactEditorCategory.cpp b/source/contacteditor/frmContactEditorCategory.cpp index eba5dad..bf2d4ea 100644 --- a/source/contacteditor/frmContactEditorCategory.cpp +++ b/source/contacteditor/frmContactEditorCategory.cpp @@ -213,7 +213,8 @@ void frmContactEditorCategory::SetEditorMode(bool EditMode) striter = CategoryListTypePtr->find(CategoryListIndex); - if (striter->first == CategoryListIndex){ + if (striter->first == CategoryListIndex && + striter != CategoryListTypePtr->end()){ strValue = striter->second; @@ -237,7 +238,8 @@ void frmContactEditorCategory::SetEditorMode(bool EditMode) intiter = CategoryListPrefPtr->find(CategoryListIndex); - if (intiter->first == CategoryListIndex && intiter->second > 0){ + if (intiter->first == CategoryListIndex && intiter->second > 0 && + intiter != CategoryListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); -- 2.39.5