From f6209a90c2e720d0e1d1bf78bf8c6196c50693d6 Mon Sep 17 00:00:00 2001 From: Daniel Folkinshteyn Date: Sun, 16 Dec 2012 23:53:13 -0500 Subject: [PATCH] String: cap maximum soundex length to 1024. --- plugins/String/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/String/plugin.py b/plugins/String/plugin.py index 1a53d2666..23b083e23 100644 --- a/plugins/String/plugin.py +++ b/plugins/String/plugin.py @@ -164,8 +164,11 @@ class String(callbacks.Plugin): Returns the Soundex hash to a given length. The length defaults to 4, since that's the standard length for a soundex hash. For unlimited - length, use 0. + length, use 0. Maximum length 1024. """ + if length > 1024: + irc.error("Maximum allowed length is 1024.") + return irc.reply(utils.str.soundex(text, length)) soundex = wrap(soundex, ['somethingWithoutSpaces', additional('int', 4)])