libedit: fix iterator off end of vector (fixes lp:1537946)

This commit is contained in:
Chris Pavlina 2016-02-09 19:04:36 -05:00 committed by Wayne Stambaugh
parent 1aa6932b12
commit c50763bd5b
1 changed files with 5 additions and 5 deletions

View File

@ -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. // 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 ); int index = aAliasList.Index( (*it)->GetName(), false );
if( index != wxNOT_FOUND || (*it)->IsRoot() ) if( index != wxNOT_FOUND || (*it)->IsRoot() )
continue; ++it;
else
it = m_aliases.erase( it ); it = m_aliases.erase( it );
} }
} }