From 9904cb6d2eb40f679d8ff6557c22d53a3e3dc75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 10 Feb 2020 07:37:11 +0100 Subject: [PATCH] irc: fix crash when receiving a malformed message 352 (who) Thanks to Stuart Nevans Locke for reporting the issue. --- ChangeLog.adoc | 1 + src/plugins/irc/irc-protocol.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 862c4d429..475255e74 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -31,6 +31,7 @@ Bug fixes:: * core: fix memory leak in completion * core: flush stdout/stderr before forking in hook_process function (issue #1441) * core: fix evaluation of condition with nested "if" (issue #1434) + * irc: fix crash when receiving a malformed message 352 (who) * irc: fix crash when a new message 005 is received with longer nick prefixes * irc: fix crash when receiving a malformed message 324 (channel mode) * irc: add nick changes in the hotlist (except self nick change) diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 05433d34e..9238e8802 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -4689,7 +4689,7 @@ IRC_PROTOCOL_CALLBACK(352) if (argc > 8) { - arg_start = (strcmp (argv[8], "*") == 0) ? 9 : 8; + arg_start = ((argc > 9) && (strcmp (argv[8], "*") == 0)) ? 9 : 8; if (argv[arg_start][0] == ':') { pos_attr = NULL;