diff --git a/Windows/Debugger/Debugger_Lists.cpp b/Windows/Debugger/Debugger_Lists.cpp index 5e7a4a8826..cd7cd5b5e7 100644 --- a/Windows/Debugger/Debugger_Lists.cpp +++ b/Windows/Debugger/Debugger_Lists.cpp @@ -129,6 +129,10 @@ void CtrlThreadList::showMenu(int itemIndex, const POINT &pt) void CtrlThreadList::GetColumnText(wchar_t* dest, int row, int col) { + if (row < 0 || row >= (int)threads.size()) { + return; + } + switch (col) { case TL_NAME: @@ -618,6 +622,10 @@ bool CtrlStackTraceView::WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, L void CtrlStackTraceView::GetColumnText(wchar_t* dest, int row, int col) { + if (row < 0 || row >= (int)frames.size()) { + return; + } + switch (col) { case SF_ENTRY: diff --git a/Windows/GEDebugger/TabDisplayLists.cpp b/Windows/GEDebugger/TabDisplayLists.cpp index a228b548f5..6ad1b1fdc7 100644 --- a/Windows/GEDebugger/TabDisplayLists.cpp +++ b/Windows/GEDebugger/TabDisplayLists.cpp @@ -33,6 +33,9 @@ CtrlDisplayListStack::CtrlDisplayListStack(HWND hwnd): GenericListControl(hwnd,d void CtrlDisplayListStack::GetColumnText(wchar_t* dest, int row, int col) { + if (row < 0 || row >= (int)ARRAY_SIZE(list.stack)) { + return; + } DisplayListStackEntry value = list.stack[row]; switch (col) @@ -77,6 +80,9 @@ CtrlAllDisplayLists::CtrlAllDisplayLists(HWND hwnd): GenericListControl(hwnd,all void CtrlAllDisplayLists::GetColumnText(wchar_t* dest, int row, int col) { + if (row < 0 || row >= (int)lists.size()) { + return; + } DisplayList& list = lists[row]; switch (col) diff --git a/Windows/GEDebugger/TabState.cpp b/Windows/GEDebugger/TabState.cpp index 51bf7bb5f2..24f1ffd03a 100644 --- a/Windows/GEDebugger/TabState.cpp +++ b/Windows/GEDebugger/TabState.cpp @@ -633,6 +633,10 @@ void FormatStateRow(wchar_t *dest, const TabStateRow &info, u32 value, bool enab } void CtrlStateValues::GetColumnText(wchar_t *dest, int row, int col) { + if (row < 0 || row >= rowCount_) { + return; + } + switch (col) { case STATEVALUES_COL_NAME: wcscpy(dest, rows_[row].title);