From 56c6ef4449b59f22533aaa80fa4fb7e19072b8ee Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 9 Jun 2014 16:36:49 -0400 Subject: [PATCH] Fix information leak in cs_updown --- modules/commands/cs_updown.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/commands/cs_updown.cpp b/modules/commands/cs_updown.cpp index b0488de26..4524a9831 100644 --- a/modules/commands/cs_updown.cpp +++ b/modules/commands/cs_updown.cpp @@ -81,6 +81,7 @@ class CommandCSUp : public Command } User *u = User::Find(nick, true); + User *srcu = source.GetUser(); bool override = false; if (u == NULL) @@ -88,6 +89,11 @@ class CommandCSUp : public Command source.Reply(NICK_X_NOT_IN_USE, nick.c_str()); return; } + else if (srcu && !srcu->FindChannel(c)) + { + source.Reply(_("You must be in \002%s\002 to use this command."), c->name.c_str()); + return; + } else if (!u->FindChannel(c)) { source.Reply(NICK_X_NOT_ON_CHAN, nick.c_str(), channel.c_str()); @@ -173,6 +179,7 @@ class CommandCSDown : public Command } User *u = User::Find(nick, true); + User *srcu = source.GetUser(); bool override = false; if (u == NULL) @@ -180,6 +187,11 @@ class CommandCSDown : public Command source.Reply(NICK_X_NOT_IN_USE, nick.c_str()); return; } + else if (srcu && !srcu->FindChannel(c)) + { + source.Reply(_("You must be in \002%s\002 to use this command."), c->name.c_str()); + return; + } else if (!u->FindChannel(c)) { source.Reply(NICK_X_NOT_ON_CHAN, nick.c_str(), channel.c_str());