Fix use-after-free in Altium importer
If the library already contains a symbol with the same name,
SaveSymbol will replace the existing symbol,
which will invalidate a cached pointer.
(cherry picked from commit d939004bbd
)
This commit is contained in:
parent
74339e9a9f
commit
46555ab975
|
@ -3053,6 +3053,11 @@ void SCH_IO_ALTIUM::ParsePowerPort( const std::map<wxString, wxString>& aPropert
|
||||||
{
|
{
|
||||||
libSymbol = powerSymbolIt->second; // cache hit
|
libSymbol = powerSymbolIt->second; // cache hit
|
||||||
}
|
}
|
||||||
|
else if( LIB_SYMBOL* alreadyLoaded =
|
||||||
|
m_pi->LoadSymbol( getLibFileName().GetFullPath(), elem.text, m_properties.get() ) )
|
||||||
|
{
|
||||||
|
libSymbol = alreadyLoaded;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
libSymbol = new LIB_SYMBOL( wxEmptyString );
|
libSymbol = new LIB_SYMBOL( wxEmptyString );
|
||||||
|
|
Loading…
Reference in New Issue