mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 00:21:25 +00:00
Limit length of search strings to prevent lockups.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19464
This commit is contained in:
parent
520a7cf62c
commit
48bb6b137c
@ -482,6 +482,12 @@ int EDA_COMBINED_MATCHER::ScoreTerms( std::vector<SEARCH_TERM>& aWeightedTerms )
|
||||
if( !term.Normalized )
|
||||
{
|
||||
term.Text = term.Text.MakeLower().Trim( false ).Trim( true );
|
||||
|
||||
// Don't cause KiCad to hang if someone accidentally pastes the PCB or schematic
|
||||
// into the search box.
|
||||
if( term.Text.Length() > 5000 )
|
||||
term.Text = term.Text.Left( 5000 );
|
||||
|
||||
term.Normalized = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user