Code

screen_play: another missing second_column NULL check
authorMax Kellermann <max@duempel.org>
Mon, 14 Sep 2009 09:43:00 +0000 (11:43 +0200)
committerMax Kellermann <max@duempel.org>
Mon, 14 Sep 2009 09:43:00 +0000 (11:43 +0200)
screen_play's list_callback could segfault, when second_column pointed
to a NULL pointer.

src/screen_play.c

index 8683ee013d7c1ef6e53de4d888778c90ff40f091..5c17f51b2d0ea509ed9678c5d31b288607d1505b 100644 (file)
@@ -130,7 +130,7 @@ list_callback(unsigned idx, bool *highlight, char **second_column, G_GNUC_UNUSED
        if (idx == lw->selected)
        {
                int second_column_len = 0;
-               if (second_column)
+               if (second_column != NULL && *second_column != NULL)
                        second_column_len = strlen(*second_column);
                if (options.scroll && utf8_width(songname) > (unsigned)(COLS - second_column_len - 1) )
                {