From 6dc9d18852bdc0893de94e3deffee7322b5ac01d Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 8 Mar 2015 23:37:45 -0500 Subject: [PATCH] Disallow absurdly long reminder lengths. --- earwigbot/commands/remind.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/earwigbot/commands/remind.py b/earwigbot/commands/remind.py index ee30ba5..154a81d 100644 --- a/earwigbot/commands/remind.py +++ b/earwigbot/commands/remind.py @@ -118,6 +118,10 @@ class Remind(Command): except ValueError: msg = "Invalid time \x02{0}\x0F. Time must be a positive integer, in seconds." return self.reply(data, msg.format(data.args[0])) + if wait > 1000 * 365 * 24 * 60 * 60: + # Hard to think of a good upper limit, but 1000 years works. + msg = "Given time \x02{0}\x0F is too large. Keep it reasonable." + return self.reply(data, msg.format(data.args[0])) message = " ".join(data.args[1:]) try: rid = self._get_new_id()