mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Prevent oob string access in SCH_REFERENCE::IsSplitNeeded
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20948
This commit is contained in:
parent
2bdc7d4872
commit
10c7796336
@ -904,6 +904,9 @@ bool SCH_REFERENCE::IsSplitNeeded()
|
|||||||
{
|
{
|
||||||
std::string refText = GetRefStr();
|
std::string refText = GetRefStr();
|
||||||
|
|
||||||
|
if( refText.empty() )
|
||||||
|
return false;
|
||||||
|
|
||||||
int ll = refText.length() - 1;
|
int ll = refText.length() - 1;
|
||||||
|
|
||||||
return ( refText[ll] == '?' ) || isdigit( refText[ll] );
|
return ( refText[ll] == '?' ) || isdigit( refText[ll] );
|
||||||
|
@ -2389,6 +2389,7 @@ int SCH_EDITOR_CONTROL::Annotate( const TOOL_EVENT& aEvent )
|
|||||||
int SCH_EDITOR_CONTROL::IncrementAnnotations( const TOOL_EVENT& aEvent )
|
int SCH_EDITOR_CONTROL::IncrementAnnotations( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
DIALOG_INCREMENT_ANNOTATIONS_BASE dlg( m_frame );
|
DIALOG_INCREMENT_ANNOTATIONS_BASE dlg( m_frame );
|
||||||
|
dlg.m_FirstRefDes->SetValidator( wxTextValidator( wxFILTER_EMPTY ) );
|
||||||
|
|
||||||
dlg.SetInitialFocus( dlg.m_FirstRefDes );
|
dlg.SetInitialFocus( dlg.m_FirstRefDes );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user