summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-11 23:58:57 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-11 23:58:57 +0000
commit394d3b9325e6498b7aca1ac12b5c76fa329f95ac (patch)
tree6035ef073cbe0beff4bdf34bd76e8e366a8e5114 /src
parent9ed99ed5f4b256cfd422d8aef0a6c28ff508ab2a (diff)
Audit cs_access and cs_akick.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2016 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/core/cs_access.c10
-rw-r--r--src/core/cs_akick.c13
2 files changed, 14 insertions, 9 deletions
diff --git a/src/core/cs_access.c b/src/core/cs_access.c
index 3adff98d1..fffa8da38 100644
--- a/src/core/cs_access.c
+++ b/src/core/cs_access.c
@@ -96,7 +96,7 @@ static int access_list_callback(User * u, int num, va_list args)
class CommandCSAccess : public Command
{
public:
- CommandCSAccess() : Command("ACCESS", 0, 4)
+ CommandCSAccess() : Command("ACCESS", 2, 4)
{
}
@@ -104,8 +104,8 @@ class CommandCSAccess : public Command
{
const char *chan = params[0].c_str();
const char *cmd = params[1].c_str();
- const char *nick = params[2].c_str();
- const char *s = params[3].c_str();
+ const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
+ const char *s = params.size() > 3 ? params[3].c_str() : NULL;
char event_access[BUFSIZE];
ChannelInfo *ci;
@@ -394,8 +394,8 @@ class CommandCSLevels : public Command
{
const char *chan = params[0].c_str();
const char *cmd = params[1].c_str();
- const char *what = params[2].c_str();
- const char *s = params[3].c_str();
+ const char *what = params.size() > 2 ? params[2].c_str() : NULL;
+ const char *s = params.size() > 3 ? params[3].c_str() : NULL;
char *error;
ChannelInfo *ci;
diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c
index 9eedef49b..bc21a81a5 100644
--- a/src/core/cs_akick.c
+++ b/src/core/cs_akick.c
@@ -161,10 +161,15 @@ class CommandCSAKick : public Command
{
const char *chan = params[0].c_str();
const char *cmd = params[1].c_str();
- const char *mask = params[2].c_str();
- if (params[5].length() > 200)
- params[5].resize(200); // XXX: is this right?
- const char *reason = params[5].c_str();
+ const char *mask = params.size() > 2 ? params[2].c_str() : NULL;
+ const char *reason = NULL;
+
+ if (params.size() > 3)
+ {
+ params[3].resize(200); // XXX: is this right?
+ reason = params[3].c_str();
+ }
+
ChannelInfo *ci;
AutoKick *akick;
int i;