From 8ab4e237d79c8ca24997bfd18b6b4b9d673b5214 Mon Sep 17 00:00:00 2001 From: Brian West <brian@freeswitch.org> Date: Mon, 9 Feb 2009 16:40:37 +0000 Subject: [PATCH] tweak time_Test to not take insane values git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11706 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_commands/mod_commands.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index ff0b78c8cf..6302a79a64 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -55,12 +55,19 @@ SWITCH_STANDARD_API(time_test_function) stream->write_function(stream, "parameter missing\n"); return SWITCH_STATUS_SUCCESS; } + mss = atol(cmd); + if (mss > 10000) { + mss = 10000; + } + if ((p = strchr(cmd, ' '))) { max = atoi(p+1); if (max < 0) { - max = 10; + max = 1; + } else if (max > 100) { + max = 100; } }