From afa5e48a1a990efa1104610d687d3cdff5b49ee6 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 23 Dec 2011 19:02:52 +0100 Subject: [PATCH] relay: fix crash when not enough arguments are received in a command of weechat protocol --- .../relay/weechat/relay-weechat-protocol.h | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.h b/src/plugins/relay/weechat/relay-weechat-protocol.h index e1a34b9a5..f1ace5494 100644 --- a/src/plugins/relay/weechat/relay-weechat-protocol.h +++ b/src/plugins/relay/weechat/relay-weechat-protocol.h @@ -38,15 +38,19 @@ (void) command; \ (void) argv; \ (void) argv_eol; \ - if ((weechat_relay_plugin->debug >= 1) && (argc < __min_args)) \ + if (argc < __min_args) \ { \ - weechat_printf (NULL, \ - _("%s%s: too few arguments received from " \ - "client %d for command \"%s\" " \ - "(received: %d arguments, expected: at " \ - "least %d)"), \ - weechat_prefix ("error"), RELAY_PLUGIN_NAME, \ - client->id, command, argc, __min_args); \ + if (weechat_relay_plugin->debug >= 1) \ + { \ + weechat_printf (NULL, \ + _("%s%s: too few arguments received from " \ + "client %d for command \"%s\" " \ + "(received: %d arguments, expected: at " \ + "least %d)"), \ + weechat_prefix ("error"), \ + RELAY_PLUGIN_NAME, \ + client->id, command, argc, __min_args); \ + } \ return WEECHAT_RC_ERROR; \ }