From d67c5973ad67678cc51a0820d58f4b09c8dc0c8a Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 12 Nov 2007 21:53:02 +0000 Subject: [PATCH] Handle negative / invalid arguments to kickrejoin correctly git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@872 726aef4b-f618-498e-8847-2d620e286838 --- modules/kickrejoin.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/kickrejoin.cpp b/modules/kickrejoin.cpp index 5a225525..bc75e3c7 100644 --- a/modules/kickrejoin.cpp +++ b/modules/kickrejoin.cpp @@ -54,9 +54,14 @@ public: else delay = sDelay.ToUInt(); } else { - delay = sArgs.ToInt(); - if (delay < 0) - delay = 0; + int i = sArgs.ToInt(); + if ((i == 0 && sArgs == "0") || i > 0) + delay = i; + else { + sErrorMsg = "Illegal argument, " + "must be a positive number or 0"; + return false; + } } return true;