From: splidge Date: Sat, 22 Mar 2008 11:27:55 +0000 (+0000) Subject: Make sure the channel exists before doing anything in OP and VOICE. X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/9b1b30fc81d883385e4ea64d4893a536ba47d043 Make sure the channel exists before doing anything in OP and VOICE. --- diff --git a/chanserv/chancmds/op.c b/chanserv/chancmds/op.c index 0bf6d45e..f114118c 100644 --- a/chanserv/chancmds/op.c +++ b/chanserv/chancmds/op.c @@ -81,6 +81,12 @@ int csc_doop(void *source, int cargc, char **cargv) { return CMD_ERROR; rcp=cip->exts[chanservext]; + + /* If the channel doesn't currently exist, forget it. */ + if (!cip->channel) { + chanservstdmessage(sender, QM_EMPTYCHAN, cip->name->content); + return CMD_ERROR; + } if (cargc==1) { /* Only one arg: "op me" */ diff --git a/chanserv/chancmds/voice.c b/chanserv/chancmds/voice.c index b6c4b468..2a4a2bbb 100644 --- a/chanserv/chancmds/voice.c +++ b/chanserv/chancmds/voice.c @@ -82,6 +82,11 @@ int csc_dovoice(void *source, int cargc, char **cargv) { if (!(cip=cs_checkaccess(sender, cargv[0], CA_VOICEPRIV, NULL, "voice", 0, 0))) return CMD_ERROR; + if (!cip->channel) { + chanservstdmessage(sender, QM_EMPTYCHAN, cip->name->content); + return CMD_ERROR; + } + if (cargc==1) { /* Only one arg: "voice me" */ if (!cs_checkaccess(sender, NULL, CA_VOICEPRIV | CA_DEVOICED, cip,