From a452d0337be5c22eab984662a2d1e1934d3aa89b Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 10 Feb 2016 01:52:44 +0000 Subject: [PATCH] Fixed potential crash with frmContactEditorXToken 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/frmContactEditorXToken.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/contacteditor/frmContactEditorXToken.cpp b/source/contacteditor/frmContactEditorXToken.cpp index e323fa5..1e12de9 100644 --- a/source/contacteditor/frmContactEditorXToken.cpp +++ b/source/contacteditor/frmContactEditorXToken.cpp @@ -118,7 +118,8 @@ void frmContactEditorXToken::SetEditorMode(bool EditMode) striter = XTokenListTokensPtr->find(XTokenListIndex); - if (striter->first == XTokenListIndex){ + if (striter->first == XTokenListIndex && + striter != XTokenListTokensPtr->end()){ strValue = striter->second; @@ -132,7 +133,8 @@ void frmContactEditorXToken::SetEditorMode(bool EditMode) striter = XTokenListPtr->find(XTokenListIndex); - if (striter->first == XTokenListIndex){ + if (striter->first == XTokenListIndex && + striter != XTokenListPtr->end()){ strValue = striter->second; -- 2.39.2