Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fixed potential crash with frmContactEditorKey in Edit mode.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 9 Feb 2016 23:53:47 +0000 (23:53 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 9 Feb 2016 23:53:47 +0000 (23:53 +0000)
This would be caused because no checks were made on the iterator to see
if it was valid or not.

source/contacteditor/frmContactEditorKey.cpp

index c80642b..569b0c3 100644 (file)
@@ -113,7 +113,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
                        
                        striter = KeyListDataTypePtr->find(KeyListIndex);
                        
-                       if (striter->first == KeyListIndex){
+                       if (striter->first == KeyListIndex &&
+                               striter != KeyListDataTypePtr->end()){
                        
                                strValue = striter->second;
                        
@@ -152,7 +153,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
                        
                        striter = KeyListDataTypePtr->find(KeyListIndex);
                        
-                       if (striter->first == KeyListIndex){
+                       if (striter->first == KeyListIndex &&
+                               striter != KeyListDataTypePtr->end()){
                        
                                strValue = striter->second;
                        
@@ -168,7 +170,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
                
                striter = KeyListTypePtr->find(KeyListIndex);   
                
-               if (striter->first == KeyListIndex){
+               if (striter->first == KeyListIndex &&
+                       striter != KeyListTypePtr->end()){
                
                        strValue = striter->second;
                
@@ -192,7 +195,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
                
                intiter = KeyListPrefPtr->find(KeyListIndex);
                
-               if (intiter->first == KeyListIndex && intiter->second > 0){
+               if (intiter->first == KeyListIndex && intiter->second > 0 &&
+                       intiter != KeyListPrefPtr->end()){
                
                        sliPriority->SetValue(intiter->second);
                        sliPriority->Enable();
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy