From fced49d82e1f444691363b4a5db1621e0904831d Mon Sep 17 00:00:00 2001 From: Erik Hovland Date: Thu, 12 Mar 2009 15:16:45 -0700 Subject: [PATCH] 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 --- curs_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curs_main.c b/curs_main.c index 7f31bf983..cf8cd9dc2 100644 --- a/curs_main.c +++ b/curs_main.c @@ -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; -- 2.40.0