From becdf76224f9bab4cd9a5ace484fb45d333952f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 12 Jan 2024 17:53:36 +0100 Subject: [PATCH] irc: check if arguments are not NULL in some infos Affected infos: - irc_server_isupport - irc_server_isupport_value - irc_server_cap - irc_server_cap_value --- ChangeLog.adoc | 1 + src/plugins/irc/irc-info.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 176b55d42..06938ba7c 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -58,6 +58,7 @@ Bug fixes:: * core: fix crash when a custom bar item name is already used by a default bar item (issue #2034) * core: fix random timeouts when a lot of concurrent processes are launched with hook_process (issue #2033) * api: return NULL instead of empty infolist "key" when context is not found + * irc: check if arguments are not NULL in some infos * irc: fix info "irc_is_message_ignored" (issue #2059) * irc: fix display of self messages when the message split fails due to inconsistent max lengths sent by the server in message 005 * irc: display messages 730/731 (monitored nicks online/offline) even if command `/notify` was not used (issue #2049) diff --git a/src/plugins/irc/irc-info.c b/src/plugins/irc/irc-info.c index 15fec209c..ea7329b98 100644 --- a/src/plugins/irc/irc-info.c +++ b/src/plugins/irc/irc-info.c @@ -344,6 +344,9 @@ irc_info_info_irc_server_isupport_cb (const void *pointer, void *data, (void) data; (void) info_name; + if (!arguments || !arguments[0]) + return NULL; + isupport_value = NULL; pos_comma = strchr (arguments, ','); if (pos_comma) @@ -382,6 +385,9 @@ irc_info_info_irc_server_isupport_value_cb (const void *pointer, void *data, (void) data; (void) info_name; + if (!arguments || !arguments[0]) + return NULL; + isupport_value = NULL; pos_comma = strchr (arguments, ','); if (pos_comma) @@ -420,6 +426,9 @@ irc_info_info_irc_server_cap_cb (const void *pointer, void *data, (void) data; (void) info_name; + if (!arguments || !arguments[0]) + return NULL; + has_cap = 0; pos_comma = strchr (arguments, ','); if (pos_comma) @@ -458,6 +467,9 @@ irc_info_info_irc_server_cap_value_cb (const void *pointer, void *data, (void) data; (void) info_name; + if (!arguments || !arguments[0]) + return NULL; + cap_value = NULL; pos_comma = strchr (arguments, ','); if (pos_comma)