From d1c6d170acf1117b8a1709eef741c6ff2cc414e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 22 Feb 2023 20:38:56 +0100 Subject: [PATCH] core: fix crash in case of NULL message sent to function gui_chat_printf_y_date_tags (issue #1883) --- ChangeLog.adoc | 1 + src/gui/gui-chat.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 3e06bc395..dc518e059 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -21,6 +21,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] Bug fixes:: * core, plugins: fix integer overflow in loops (issue #2178) + * core: fix crash in case of NULL message sent to function gui_chat_printf_y_date_tags (issue #1883) Build:: diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index 7b89f2a0f..6841b95ff 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -906,6 +906,9 @@ gui_chat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date, time_t date_printed; int i, last_y, num_lines_to_add; + if (!message) + return; + if (gui_init_ok && !gui_chat_buffer_valid (buffer, GUI_BUFFER_TYPE_FREE)) return;