From 273d09ba1a2d15d19f97b4d139479167c6a47633 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Fri, 4 Dec 2015 22:01:32 +0100 Subject: [PATCH] Fix crasher on empty list --- source/rofi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/rofi.c b/source/rofi.c index ecaaf461..fc2a9abb 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1615,7 +1615,9 @@ MenuReturn menu ( Mode *sw, char **input, char *prompt, unsigned int *selected_l *input = g_strdup ( state.text->text ); if ( next_pos ) { - *( next_pos ) = state.line_map[state.selected + 1]; + if((state.selected+1)< state.num_lines){ + *( next_pos ) = state.line_map[state.selected + 1]; + } } int retv = state.retv;