mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-05 05:39:22 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user