Merge branch '4064_garbage_in_history'

* 4064_garbage_in_history:
  Ticket #4064: fix garbage in history.
This commit is contained in:
Andrew Borodin 2020-02-22 09:33:30 +03:00
commit 109b6ed80b
1 changed files with 3 additions and 0 deletions

View File

@ -180,7 +180,10 @@ do_show_hist (WInput * in)
g_list_position (in->history.list, in->history.list));
history_show (&hd);
/* in->history.list was destroyed in history_show().
* Apply new history and current postition to avoid use-after-free. */
in->history.list = hd.list;
in->history.current = in->history.list;
if (hd.text != NULL)
{
input_assign_text (in, hd.text);