← Back to team overview

kicad-developers team mailing list archive

Crash changing color

 

Seems that the ColorRef is overruned in WinEDA_SelColorFrame::WinEDA_SelColorFrame.

I propose this change to avoid to get out of bounds of the array.
--
Marco

Index: selcolor.cpp
===================================================================
--- selcolor.cpp	(revision 1863)
+++ selcolor.cpp	(working copy)
@@ -98,7 +98,7 @@
MainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
OuterBoxSizer->Add( MainBoxSizer, 1, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
 
- for( ii = 0; ColorRefs[ii].m_Name != NULL; ii++ )
+ for( ii = 0; ColorRefs[ii].m_Name != NULL && ii < NBCOLOR; ii++ )
{
// Provide a separate column for every eight buttons (and their
// associated text strings), so provide a FlexGrid Sizer with