]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak time_Test to not take insane values
authorBrian West <brian@freeswitch.org>
Mon, 9 Feb 2009 16:40:37 +0000 (16:40 +0000)
committerBrian West <brian@freeswitch.org>
Mon, 9 Feb 2009 16:40:37 +0000 (16:40 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11706 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_commands/mod_commands.c

index ff0b78c8cfe08ff906d5371e429c9a96078ec36a..6302a79a6417d96f3bc70d84d5b013e420dad988 100644 (file)
@@ -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;
                }
        }