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: mutt-1-5-20-rel~183 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a75ec3be4242f8b84890b703e5b1c2160f57a3cc;p=mutt 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 7f31bf98..cf8cd9dc 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;