From c50763bd5b8af58b66db9837694e99bb03c725b9 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Tue, 9 Feb 2016 19:04:36 -0500 Subject: [PATCH] libedit: fix iterator off end of vector (fixes lp:1537946) --- eeschema/class_libentry.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index cca83e4337..7941d8e511 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -1754,16 +1754,16 @@ void LIB_PART::SetAliases( const wxArrayString& aAliasList ) } // Remove names in the current component that are not in the new alias list. - LIB_ALIASES::iterator it; + LIB_ALIASES::iterator it = m_aliases.begin(); - for( it = m_aliases.begin(); it < m_aliases.end(); it++ ) + while( it != m_aliases.end() ) { int index = aAliasList.Index( (*it)->GetName(), false ); if( index != wxNOT_FOUND || (*it)->IsRoot() ) - continue; - - it = m_aliases.erase( it ); + ++it; + else + it = m_aliases.erase( it ); } }