From f851246ff667a5ab9fb03675a368988028180f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 27 Jun 2017 07:18:16 +0200 Subject: [PATCH] buflist: fix crash in auto-scroll of bar when the buflist item is not the first item in the bar --- ChangeLog.adoc | 4 ++++ src/plugins/buflist/buflist-bar-item.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 55d434801..2036b6e4a 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -22,6 +22,10 @@ New features:: * fset: new plugin "fset" (fast set of WeeChat and plugins options) +Bug fixes:: + + * buflist: fix crash in auto-scroll of bar when the buflist item is not the first item in the bar + [[v1.9]] == Version 1.9 (2017-06-25) diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index 6abfb64ab..d60ecfb45 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -104,8 +104,11 @@ buflist_bar_item_bar_can_scroll (struct t_gui_bar *bar) if (!items_subcount || (items_subcount[0] <= 0)) return 0; items_name = weechat_hdata_pointer (buflist_hdata_bar, bar, "items_name"); - if (!items_name || (strcmp (items_name[0][0], BUFLIST_BAR_ITEM_NAME) != 0)) + if (!items_name || !items_name[0] || !items_name[0][0] + || (strcmp (items_name[0][0], BUFLIST_BAR_ITEM_NAME) != 0)) + { return 0; + } /* OK, bar can be scrolled! */ return 1;