From: Erik Hovland Date: Thu, 12 Mar 2009 22:16:45 +0000 (-0700) Subject: resort_index will use menu->current as a index into an array. X-Git-Tag: neomutt-20160307~757 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fced49d82e1f444691363b4a5db1621e0904831d;p=neomutt 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 --- 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;