summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-01-15 12:09:05 +0000
committerSadie Powell <sadie@witchery.services>2020-01-15 12:12:03 +0000
commitc299adb31a9866a50eff7779c7ba513095a79feb (patch)
tree940224190560ccffc2a7b1dfa1cd4cdf35498337
parent88d1811905675c84b5ef96ff157d304e0e5f4e9a (diff)
Prevent users from sending an empty TAGMSG.
-rw-r--r--src/modules/m_ircv3_ctctags.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/m_ircv3_ctctags.cpp b/src/modules/m_ircv3_ctctags.cpp
index 06896c905..e22c1f125 100644
--- a/src/modules/m_ircv3_ctctags.cpp
+++ b/src/modules/m_ircv3_ctctags.cpp
@@ -41,6 +41,13 @@ class CommandTagMsg : public Command
return false;
}
+ // Check whether a module zapped the message tags.
+ if (msgdetails.tags_out.empty())
+ {
+ source->WriteNumeric(ERR_NOTEXTTOSEND, "No tags to send");
+ return false;
+ }
+
// Inform modules that a TAGMSG is about to be sent.
FOREACH_MOD_CUSTOM(tagevprov, CTCTags::EventListener, OnUserTagMessage, (source, msgtarget, msgdetails));
return true;
@@ -209,6 +216,13 @@ class CommandTagMsg : public Command
if (CommandParser::LoopCall(user, this, parameters, 0))
return CMD_SUCCESS;
+ // The specified message tags were empty.
+ if (parameters.GetTags().empty())
+ {
+ user->WriteNumeric(ERR_NOTEXTTOSEND, "No tags to send");
+ return CMD_FAILURE;
+ }
+
// Check that the source has the message tags capability.
if (IS_LOCAL(user) && !cap.get(user))
return CMD_FAILURE;