Bounds checking (KICAD-GGM).

This commit is contained in:
Jeff Young 2025-07-11 15:50:42 +01:00
parent 58def05886
commit e51908e6c8

View File

@ -170,8 +170,7 @@ void LTSPICE_SCHEMATIC::Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet,
ascFiles[ascFiles[i].ParentIndex].Sheet->GetScreen()->Append( curSheet ); ascFiles[ascFiles[i].ParentIndex].Sheet->GetScreen()->Append( curSheet );
curSheet->GetScreen()->SetFileName( m_schematic->Prj().GetProjectPath() + sheetName curSheet->GetScreen()->SetFileName( m_schematic->Prj().GetProjectPath() + sheetName + ".kicad_sch" );
+ ".kicad_sch" );
} }
else else
{ {
@ -219,10 +218,10 @@ void LTSPICE_SCHEMATIC::GetAscAndAsyFilePaths( const wxDir& aDir, bool aRecursiv
{ {
if( m_reporter ) if( m_reporter )
{ {
m_reporter->Report( wxString::Format( m_reporter->Report( wxString::Format( _( "File at '%s' was ignored. Using previously "
_( "File at '%s' was ignored. Using previously found " "found file at '%s' instead." ),
"file at '%s' instead." ), path.GetFullPath(),
path.GetFullPath(), aMapToLogTo.at( aKey ) ) ); aMapToLogTo.at( aKey ) ) );
} }
} }
else else
@ -315,7 +314,7 @@ std::vector<LTSPICE_FILE> LTSPICE_SCHEMATIC::GetSchematicElements( const wxStrin
{ {
wxArrayString tokens = wxSplit( line, ' ' ); wxArrayString tokens = wxSplit( line, ' ' );
if( !tokens.IsEmpty() && tokens[0].Upper() == wxS( "SYMBOL" ) ) if( tokens.size() >= 4 && tokens[0].Upper() == wxS( "SYMBOL" ) )
{ {
wxString elementName( tokens[1] ); wxString elementName( tokens[1] );
long posX, posY; long posX, posY;