From f845a8dc718dd915efec0e10f664148839b371f4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 30 Jun 2020 01:04:31 +0200 Subject: [PATCH] Always initialize wxGridCellBoolEditor::m_value Do it even when the cell value is not one of the recognized boolean representations, as we later use m_value as an index into a 2 element array and leaving it uninitialized could result in an out of bound access, so make sure this doesn't happen. --- src/generic/grideditors.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index 288b080b2a..3b5b2b1e2a 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -1430,6 +1430,9 @@ void wxGridCellBoolEditor::SetValueFromGrid(int row, int col, wxGrid* grid) // this risks to be very surprising for the user code, let them // know about it wxFAIL_MSG( wxT("invalid value for a cell with bool editor!") ); + + // Still need to initialize it to something. + m_value = false; } } }