summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-08-03 20:01:15 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-08-03 20:01:15 +0200
commit79d50837c91ffe5920f4e3c0f2b380169a7b2a2f (patch)
tree0c9844410df371db9d32acdca291d7660aedbcb8
parent791b910a77b24053309d2ae308aed37da0da166c (diff)
downloadweechat-79d50837c91ffe5920f4e3c0f2b380169a7b2a2f.zip
irc: fix read out of bounds in case of malformed AUTHENTICATE message (issue #1679)
-rw-r--r--src/plugins/irc/irc-protocol.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 9eb6e8de5..70a78348f 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -408,6 +408,8 @@ IRC_PROTOCOL_CALLBACK(authenticate)
return WEECHAT_RC_OK;
arg_data = (argv[0][0] == ':') ? 2 : 1;
+ if (arg_data >= argc)
+ return WEECHAT_RC_OK;
ptr_data = (argv_eol[arg_data][0] == ':') ?
argv_eol[arg_data] + 1 : argv_eol[arg_data];