From 02aa2682dcd6de0defcdc88756dd92e25ae268a4 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Sun, 24 Jun 2012 14:33:54 +0000 Subject: [PATCH] Fix crash in mainwindows_resize_smaller when the 'mainwindows' list is empty. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The crash can happen if the terminal height decreases before the first window is created. Based on a patch by Jaroslav Škarvada (red hat bug #796457). git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5217 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/mainwindows.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index 6cb567cc..5f58c25f 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -355,6 +355,9 @@ static void mainwindows_resize_smaller(int xdiff, int ydiff) int space; sorted = mainwindows_get_sorted(TRUE); + if (sorted == NULL) + return; + for (;;) { space = 0; for (tmp = mainwindows; tmp != NULL; tmp = tmp->next) {