summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-06-27 07:18:16 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-09-23 12:41:53 +0200
commitf30d556e25c7e83a26ecd8e175d94284cf54de7d (patch)
tree1615b2d46e4e5137db88dd0b9a4dd291cb24f779
parentlogger: call strftime before replacing buffer local variables (diff)
downloadweechat-f30d556e25c7e83a26ecd8e175d94284cf54de7d.tar.xz
weechat-f30d556e25c7e83a26ecd8e175d94284cf54de7d.zip
buflist: fix crash in auto-scroll of bar when the buflist item is not the first item in the bar
(cherry picked from commit f851246ff667a5ab9fb03675a368988028180f9c)
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/plugins/buflist/buflist-bar-item.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 8ef88fd64..694fc38c4 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
Bug fixes::
+ * buflist: fix crash in auto-scroll of bar when the buflist item is not the first item in the bar
* logger: call strftime before replacing buffer local variables
[[v1.9]]
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;