summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-16 12:12:26 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-16 12:12:26 +0000
commit6112d479f9aa1710d3d4de30d00cedc6c3ebf81d (patch)
tree5a629d55b985a20dadcb1e1f730ff86e48161ab5
parent04fe8e623cc87fc07388dcb3701e348211fa8125 (diff)
Wild pointers do not a happy Anope make. Thanks DP :)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2084 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--src/core/cs_register.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/cs_register.c b/src/core/cs_register.c
index 2caeaa567..36c5a747b 100644
--- a/src/core/cs_register.c
+++ b/src/core/cs_register.c
@@ -30,7 +30,6 @@ class CommandCSRegister : public Command
const char *chan = params[0].c_str();
const char *pass = params[1].c_str();
const char *desc = params[2].c_str();
- NickCore *nc;
Channel *c;
ChannelInfo *ci;
struct u_chaninfolist *uc;
@@ -72,8 +71,8 @@ class CommandCSRegister : public Command
notice_lang(s_ChanServ, u, CHAN_MAY_NOT_BE_REGISTERED, chan);
else if (!chan_has_user_status(c, u, CUS_OP))
notice_lang(s_ChanServ, u, CHAN_MUST_BE_CHANOP);
- else if (!is_servadmin && CSMaxReg && nc->channelcount >= CSMaxReg)
- notice_lang(s_ChanServ, u, nc->channelcount > CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, CSMaxReg);
+ else if (!is_servadmin && CSMaxReg && u->nc->channelcount >= CSMaxReg)
+ notice_lang(s_ChanServ, u, u->nc->channelcount > CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, CSMaxReg);
else if (!stricmp(u->nick, pass) || (StrictPasswords && strlen(pass) < 5))
notice_lang(s_ChanServ, u, MORE_OBSCURE_PASSWORD);
else if (enc_encrypt_check_len(strlen(pass), PASSMAX - 1))
@@ -99,7 +98,7 @@ class CommandCSRegister : public Command
ci->mlock_on = ircd->defmlock;
ci->memos.memomax = MSMaxMemos;
ci->last_used = ci->time_registered;
- ci->founder = nc;
+ ci->founder = u->nc;
memcpy(ci->founderpass, founderpass, PASSMAX);
ci->desc = sstrdup(desc);