irc: fix read out of bounds in case of malformed AUTHENTICATE message (issue #1679)

This commit is contained in:
Sébastien Helleu 2021-08-03 20:01:15 +02:00
parent 791b910a77
commit 79d50837c9

View File

@ -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];