ui: bound the input history size.

Only the lower end was checked, so a large value threw bad_alloc and exited.
This commit is contained in:
xirvik
2026-08-08 16:48:10 +00:00
committed by Jari Sundell
parent 161a36dedd
commit 44bb2d691f
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -54,6 +54,11 @@ public:
typedef std::vector<std::string> InputHistoryCategory;
typedef std::map<int, InputHistoryCategory> InputHistory;
// Every category holds this many entries, and the whole history is written to
// and read back from the session, so the useful range ends long before the
// point where resizing it becomes a memory problem.
static constexpr int max_input_history_size = 4096;
Root();
void init(Control* c);