mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 14:56:58 +00:00
AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@211528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3822,7 +3822,7 @@ static int aqm_exec(struct ast_channel *chan, void *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;
|
||||
}
|
||||
@@ -3961,7 +3961,7 @@ static int queue_exec(struct ast_channel *chan, void *data)
|
||||
/* Get the priority from the variable ${QUEUE_PRIO} */
|
||||
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) {
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "%s: Got priority %d from ${QUEUE_PRIO}.\n",
|
||||
chan->name, prio);
|
||||
@@ -3978,7 +3978,7 @@ static int queue_exec(struct ast_channel *chan, void *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) {
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "%s: Got max penalty %d from ${QUEUE_MAX_PENALTY}.\n",
|
||||
chan->name, max_penalty);
|
||||
@@ -4865,7 +4865,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))
|
||||
@@ -4969,7 +4969,7 @@ static int handle_queue_add_member(int fd, int argc, char *argv[])
|
||||
queuename = argv[5];
|
||||
interface = argv[3];
|
||||
if (argc >= 8) {
|
||||
if (sscanf(argv[7], "%d", &penalty) == 1) {
|
||||
if (sscanf(argv[7], "%30d", &penalty) == 1) {
|
||||
if (penalty < 0) {
|
||||
ast_cli(fd, "Penalty must be >= 0\n");
|
||||
penalty = 0;
|
||||
|
Reference in New Issue
Block a user