diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2016-08-02 18:29:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-02 18:29:12 +0200 |
commit | 24d9abf46de539555d45a92e82dd22d6b4489a81 (patch) | |
tree | cd9f9cbb098820df38f8cff9a1fbab11a5e20dcc /src | |
parent | ee16e226fe1c3a0a46c9d52d076885f270671dc3 (diff) | |
parent | e7fd68c29e712785519742991c5085e0a247b019 (diff) | |
download | weechat-24d9abf46de539555d45a92e82dd22d6b4489a81.zip |
Merge pull request #738 from scumjr/master
irc: fix NULL pointer dereference in 734 command callback
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index b6a9cae24..91280103b 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -5384,8 +5384,13 @@ IRC_PROTOCOL_CALLBACK(733) IRC_PROTOCOL_CALLBACK(734) { + char *pos_args; + IRC_PROTOCOL_MIN_ARGS(5); + pos_args = (argc > 5) ? + ((argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5]) : NULL; + weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer ( server, NULL, command, "monitor", NULL), @@ -5393,7 +5398,7 @@ IRC_PROTOCOL_CALLBACK(734) irc_protocol_tags (command, "irc_numeric", NULL, NULL), "%s%s (%s)", weechat_prefix ("error"), - (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5], + (pos_args && pos_args[0]) ? pos_args : "", argv[3]); return WEECHAT_RC_OK; |