summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-05-25 19:28:49 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-05-25 19:28:49 +0200
commit2488466b0cc9e26db505614424829ae4f9717950 (patch)
tree0a05209a7d36f18258eaa4e888f476d9b8fab069
parent647ca0c0472b327425ad651748f2a0e7cbf176a0 (diff)
downloadweechat-2488466b0cc9e26db505614424829ae4f9717950.zip
irc: fix crash in split of IRC message containing a newline if the server is not given
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/plugins/irc/irc-message.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index a15dcc2f6..0aa87ebb5 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -74,6 +74,7 @@
* core: remove trailing directory separators in home directories (issue #2070)
* exec: remove trailing space on buffers with free content when line numbers are not displayed
* exec: add missing exec tags in lines of buffers with free content (issue #2086)
+* irc: fix crash in split of IRC message containing a newline if the server is not given
* irc: fix display of reply for CTCP request received on a channel when capability echo-message is enabled
* irc: display CTCP reply to a nick in server buffer instead of channel
* irc: add missing tags on self action messages when capability echo-message is enabled (issue #2074)
diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c
index 2dc822f1f..052b07282 100644
--- a/src/plugins/irc/irc-message.c
+++ b/src/plugins/irc/irc-message.c
@@ -1667,8 +1667,9 @@ irc_message_split (struct t_irc_server *server, const char *message)
}
multiline = (
- ((weechat_strcasecmp (command, "privmsg") == 0)
- || (weechat_strcasecmp (command, "notice") == 0))
+ server
+ && ((weechat_strcasecmp (command, "privmsg") == 0)
+ || (weechat_strcasecmp (command, "notice") == 0))
&& message
&& strchr (message, '\n')
&& (index_args + 1 <= argc - 1)