From 62fced321317268ffe0542fa093bf56959eefd57 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 77a7df345..57868a269 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -17,6 +17,7 @@ Bug fixes:: * core: fix crash on plugin reload when using musl libc (issue #2052) * core: fix infinite loop in display when the chat area is too small (issue #2053) + * 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 diff --git a/src/plugins/irc/irc-info.c b/src/plugins/irc/irc-info.c index d975a84d5..922e3172d 100644 --- a/src/plugins/irc/irc-info.c +++ b/src/plugins/irc/irc-info.c @@ -343,6 +343,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) @@ -381,6 +384,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) @@ -419,6 +425,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) @@ -457,6 +466,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)