From 3b1da98385debe24001f0432f8d6f674f2710c31 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 10 Feb 2016 01:18:10 +0000 Subject: [PATCH] Fixed potential crash with frmContactEditorVendor 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/frmContactEditorVendor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/contacteditor/frmContactEditorVendor.cpp b/source/contacteditor/frmContactEditorVendor.cpp index 4696a9d..ce56648 100644 --- a/source/contacteditor/frmContactEditorVendor.cpp +++ b/source/contacteditor/frmContactEditorVendor.cpp @@ -67,7 +67,8 @@ void frmContactEditorVendor::SetEditorMode(bool EditMode) striter = VendorListElementPtr->find(VendorListIndex); - if (striter->first == VendorListIndex){ + if (striter->first == VendorListIndex && + striter != VendorListElementPtr->end()){ strValue = striter->second; @@ -81,7 +82,8 @@ void frmContactEditorVendor::SetEditorMode(bool EditMode) striter = VendorListPtr->find(VendorListIndex); - if (striter->first == VendorListIndex){ + if (striter->first == VendorListIndex && + striter != VendorListPtr->end()){ strValue = striter->second; -- 2.39.2