]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
This patch handles the case where a queue member with a negative penalty is added
authorMark Michelson <mmichelson@digium.com>
Thu, 29 Nov 2007 19:38:39 +0000 (19:38 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 29 Nov 2007 19:38:39 +0000 (19:38 +0000)
via the manager. If a negative value is submitted for a member penalty, we set it to 0.

(closes issue #11411, reported and patched by Laureano)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90163 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index de06df86190c85890d7f41e839d55cc71e9069c4..da99ab0a3153f78e9058b7323a254225499b3650 100644 (file)
@@ -4381,7 +4381,7 @@ static int manager_add_queue_member(struct mansession *s, const struct message *
 
        if (ast_strlen_zero(penalty_s))
                penalty = 0;
-       else if (sscanf(penalty_s, "%d", &penalty) != 1)
+       else if (sscanf(penalty_s, "%d", &penalty) != 1 || penalty < 0)
                penalty = 0;
 
        if (ast_strlen_zero(paused_s))