From: Steve Brokenshire Date: Wed, 10 Feb 2016 01:52:44 +0000 (+0000) Subject: Fixed potential crash with frmContactEditorXToken in Edit mode. X-Git-Tag: release-0.09~15 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=a452d0337be5c22eab984662a2d1e1934d3aa89b;p=xestiaab%2F.git 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. --- 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;