mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +00:00
AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5155,7 +5155,7 @@ static int aqm_exec(struct ast_channel *chan, const char *data)
|
||||
}
|
||||
|
||||
if (!ast_strlen_zero(args.penalty)) {
|
||||
if ((sscanf(args.penalty, "%d", &penalty) != 1) || penalty < 0) {
|
||||
if ((sscanf(args.penalty, "%30d", &penalty) != 1) || penalty < 0) {
|
||||
ast_log(LOG_WARNING, "Penalty '%s' is invalid, must be an integer >= 0\n", args.penalty);
|
||||
penalty = 0;
|
||||
}
|
||||
@@ -5316,7 +5316,7 @@ static int queue_exec(struct ast_channel *chan, const char *data)
|
||||
ast_channel_lock(chan);
|
||||
user_priority = pbx_builtin_getvar_helper(chan, "QUEUE_PRIO");
|
||||
if (user_priority) {
|
||||
if (sscanf(user_priority, "%d", &prio) == 1) {
|
||||
if (sscanf(user_priority, "%30d", &prio) == 1) {
|
||||
ast_debug(1, "%s: Got priority %d from ${QUEUE_PRIO}.\n", chan->name, prio);
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "${QUEUE_PRIO}: Invalid value (%s), channel %s.\n",
|
||||
@@ -5331,7 +5331,7 @@ static int queue_exec(struct ast_channel *chan, const char *data)
|
||||
/* Get the maximum penalty from the variable ${QUEUE_MAX_PENALTY} */
|
||||
|
||||
if ((max_penalty_str = pbx_builtin_getvar_helper(chan, "QUEUE_MAX_PENALTY"))) {
|
||||
if (sscanf(max_penalty_str, "%d", &max_penalty) == 1) {
|
||||
if (sscanf(max_penalty_str, "%30d", &max_penalty) == 1) {
|
||||
ast_debug(1, "%s: Got max penalty %d from ${QUEUE_MAX_PENALTY}.\n", chan->name, max_penalty);
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "${QUEUE_MAX_PENALTY}: Invalid value (%s), channel %s.\n",
|
||||
@@ -5343,7 +5343,7 @@ static int queue_exec(struct ast_channel *chan, const char *data)
|
||||
}
|
||||
|
||||
if ((min_penalty_str = pbx_builtin_getvar_helper(chan, "QUEUE_MIN_PENALTY"))) {
|
||||
if (sscanf(min_penalty_str, "%d", &min_penalty) == 1) {
|
||||
if (sscanf(min_penalty_str, "%30d", &min_penalty) == 1) {
|
||||
ast_debug(1, "%s: Got min penalty %d from ${QUEUE_MIN_PENALTY}.\n", chan->name, min_penalty);
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "${QUEUE_MIN_PENALTY}: Invalid value (%s), channel %s.\n",
|
||||
@@ -6712,7 +6712,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 || penalty < 0)
|
||||
else if (sscanf(penalty_s, "%30d", &penalty) != 1 || penalty < 0)
|
||||
penalty = 0;
|
||||
|
||||
if (ast_strlen_zero(paused_s))
|
||||
@@ -6952,7 +6952,7 @@ static char *handle_queue_add_member(struct ast_cli_entry *e, int cmd, struct as
|
||||
queuename = a->argv[5];
|
||||
interface = a->argv[3];
|
||||
if (a->argc >= 8) {
|
||||
if (sscanf(a->argv[7], "%d", &penalty) == 1) {
|
||||
if (sscanf(a->argv[7], "%30d", &penalty) == 1) {
|
||||
if (penalty < 0) {
|
||||
ast_cli(a->fd, "Penalty must be >= 0\n");
|
||||
penalty = 0;
|
||||
|
Reference in New Issue
Block a user