Commit a75ec3be authored by Erik Hovland's avatar Erik Hovland

resort_index will use menu->current as a index into an array.

If menu->current is negative, bad things can happen. So check
it before calling resort_index
parent 6fbe6b75
......@@ -452,7 +452,7 @@ int mutt_index_menu (void)
* any 'op' below could do mutt_enter_command(), either here or
* from any new menu launched, and change $sort/$sort_aux
if (option (OPTNEEDRESORT) && Context && Context->msgcount)
if (option (OPTNEEDRESORT) && Context && Context->msgcount && menu->current >= 0)
resort_index (menu);
menu->max = Context ? Context->vcount : 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment