1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 05:16:38 +02:00

relay: fix crash when not enough arguments are received in a command of weechat protocol

This commit is contained in:
Sebastien Helleu
2011-12-23 19:02:52 +01:00
parent 7610b9b00c
commit afa5e48a1a
@@ -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; \
}