summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-03-01 22:32:13 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-03-01 22:32:13 +0100
commit371bf4b401fab44f18bf8766cd434116da14425a (patch)
tree42b778913afd7f476806a14fe8b91662736f7e77 /src/plugins
parent882be565c331efe10bb45a5f9fd3b0fd35a8222d (diff)
downloadweechat-371bf4b401fab44f18bf8766cd434116da14425a.zip
Fix crash with IRC commands msg/notice/query/quote when executed with too few arguments (bug #25739)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-command.c12
-rw-r--r--src/plugins/irc/irc-command.h2
2 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 4f12b1287..97361203e 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -1972,7 +1972,8 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
if (argc <= 2)
{
- IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "msg");
+ IRC_COMMAND_TOO_FEW_ARGUMENTS((ptr_server) ? ptr_server->buffer : NULL,
+ "msg");
}
arg_target = 1;
@@ -2252,7 +2253,8 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc,
}
else
{
- IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "notice");
+ IRC_COMMAND_TOO_FEW_ARGUMENTS((ptr_server) ? ptr_server->buffer : NULL,
+ "notice");
}
return WEECHAT_RC_OK;
@@ -2529,7 +2531,8 @@ irc_command_query (void *data, struct t_gui_buffer *buffer, int argc,
}
else
{
- IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "query");
+ IRC_COMMAND_TOO_FEW_ARGUMENTS((ptr_server) ? ptr_server->buffer : NULL,
+ "query");
}
return WEECHAT_RC_OK;
@@ -2566,7 +2569,8 @@ irc_command_quote (void *data, struct t_gui_buffer *buffer, int argc,
}
else
{
- IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "quote");
+ IRC_COMMAND_TOO_FEW_ARGUMENTS((ptr_server) ? ptr_server->buffer : NULL,
+ "quote");
}
return WEECHAT_RC_OK;
diff --git a/src/plugins/irc/irc-command.h b/src/plugins/irc/irc-command.h
index c4404d758..aa23fee9e 100644
--- a/src/plugins/irc/irc-command.h
+++ b/src/plugins/irc/irc-command.h
@@ -28,7 +28,7 @@ struct t_irc_server;
irc_buffer_get_server_prefix (ptr_server, "error"), \
IRC_PLUGIN_NAME, \
__command); \
- return WEECHAT_RC_ERROR;
+ return WEECHAT_RC_OK;
#define IRC_COMMAND_CHECK_SERVER(__command, __check_connection) \
if (!ptr_server) \