aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-10 19:12:35 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-10 19:12:35 +0000
commit248d8c804f87e0405ec66454fe7e0e30db14bb8d (patch)
tree872527e87b8284baaa5d1ab1d447a5551fac6cb0 /res
parent6684417af1a95717df6f035c0eb6d4242c2d799a (diff)
AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@211526 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c26
-rw-r--r--res/res_features.c8
-rw-r--r--res/res_osp.c10
3 files changed, 22 insertions, 22 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 53cafd58c..85a701ee0 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -399,7 +399,7 @@ static int handle_waitfordigit(struct ast_channel *chan, AGI *agi, int argc, cha
int to;
if (argc != 4)
return RESULT_SHOWUSAGE;
- if (sscanf(argv[3], "%d", &to) != 1)
+ if (sscanf(argv[3], "%30d", &to) != 1)
return RESULT_SHOWUSAGE;
res = ast_waitfordigit_full(chan, to, agi->audio, agi->ctrl);
fdprintf(agi->fd, "200 result=%d\n", res);
@@ -518,7 +518,7 @@ static int handle_controlstreamfile(struct ast_channel *chan, AGI *agi, int argc
else
stop = NULL;
- if ((argc > 5) && (sscanf(argv[5], "%d", &skipms) != 1))
+ if ((argc > 5) && (sscanf(argv[5], "%30d", &skipms) != 1))
return RESULT_SHOWUSAGE;
if (argc > 6 && !ast_strlen_zero(argv[6]))
@@ -557,7 +557,7 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, char
return RESULT_SHOWUSAGE;
if (argc > 5)
return RESULT_SHOWUSAGE;
- if ((argc > 4) && (sscanf(argv[4], "%ld", &sample_offset) != 1))
+ if ((argc > 4) && (sscanf(argv[4], "%30ld", &sample_offset) != 1))
return RESULT_SHOWUSAGE;
fs = ast_openstream(chan, argv[2], chan->language);
@@ -660,7 +660,7 @@ static int handle_saynumber(struct ast_channel *chan, AGI *agi, int argc, char *
int num;
if (argc != 4)
return RESULT_SHOWUSAGE;
- if (sscanf(argv[2], "%d", &num) != 1)
+ if (sscanf(argv[2], "%30d", &num) != 1)
return RESULT_SHOWUSAGE;
res = ast_say_number_full(chan, num, argv[3], chan->language, (char *) NULL, agi->audio, agi->ctrl);
if (res == 1)
@@ -679,7 +679,7 @@ static int handle_saydigits(struct ast_channel *chan, AGI *agi, int argc, char *
if (argc != 4)
return RESULT_SHOWUSAGE;
- if (sscanf(argv[2], "%d", &num) != 1)
+ if (sscanf(argv[2], "%30d", &num) != 1)
return RESULT_SHOWUSAGE;
res = ast_say_digit_str_full(chan, argv[2], argv[3], chan->language, agi->audio, agi->ctrl);
@@ -715,7 +715,7 @@ static int handle_saydate(struct ast_channel *chan, AGI *agi, int argc, char *ar
int num;
if (argc != 4)
return RESULT_SHOWUSAGE;
- if (sscanf(argv[2], "%d", &num) != 1)
+ if (sscanf(argv[2], "%30d", &num) != 1)
return RESULT_SHOWUSAGE;
res = ast_say_date(chan, num, argv[3], chan->language);
if (res == 1)
@@ -733,7 +733,7 @@ static int handle_saytime(struct ast_channel *chan, AGI *agi, int argc, char *ar
int num;
if (argc != 4)
return RESULT_SHOWUSAGE;
- if (sscanf(argv[2], "%d", &num) != 1)
+ if (sscanf(argv[2], "%30d", &num) != 1)
return RESULT_SHOWUSAGE;
res = ast_say_time(chan, num, argv[3], chan->language);
if (res == 1)
@@ -767,7 +767,7 @@ static int handle_saydatetime(struct ast_channel *chan, AGI *agi, int argc, char
if (argc > 5 && !ast_strlen_zero(argv[5]))
zone = argv[5];
- if (sscanf(argv[2], "%ld", &unixtime) != 1)
+ if (sscanf(argv[2], "%30ld", &unixtime) != 1)
return RESULT_SHOWUSAGE;
res = ast_say_date_with_format(chan, (time_t) unixtime, argv[3], chan->language, format, zone);
@@ -853,7 +853,7 @@ static int handle_setpriority(struct ast_channel *chan, AGI *agi, int argc, char
if (argc != 3)
return RESULT_SHOWUSAGE;
- if (sscanf(argv[2], "%d", &pri) != 1) {
+ if (sscanf(argv[2], "%30d", &pri) != 1) {
if ((pri = ast_findlabel_extension(chan, chan->context, chan->exten, argv[2], chan->cid.cid_num)) < 1)
return RESULT_SHOWUSAGE;
}
@@ -885,7 +885,7 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
if (argc < 6)
return RESULT_SHOWUSAGE;
- if (sscanf(argv[5], "%d", &ms) != 1)
+ if (sscanf(argv[5], "%30d", &ms) != 1)
return RESULT_SHOWUSAGE;
if (argc > 6)
@@ -926,7 +926,7 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
/* backward compatibility, if no offset given, arg[6] would have been
* caught below and taken to be a beep, else if it is a digit then it is a
* offset */
- if ((argc >6) && (sscanf(argv[6], "%ld", &sample_offset) != 1) && (!strchr(argv[6], '=')))
+ if ((argc >6) && (sscanf(argv[6], "%30ld", &sample_offset) != 1) && (!strchr(argv[6], '=')))
res = ast_streamfile(chan, "beep", chan->language);
if ((argc > 7) && (!strchr(argv[7], '=')))
@@ -1044,7 +1044,7 @@ static int handle_autohangup(struct ast_channel *chan, AGI *agi, int argc, char
if (argc != 3)
return RESULT_SHOWUSAGE;
- if (sscanf(argv[2], "%d", &timeout) != 1)
+ if (sscanf(argv[2], "%30d", &timeout) != 1)
return RESULT_SHOWUSAGE;
if (timeout < 0)
timeout = 0;
@@ -1215,7 +1215,7 @@ static int handle_verbose(struct ast_channel *chan, AGI *agi, int argc, char **a
return RESULT_SHOWUSAGE;
if (argv[2])
- sscanf(argv[2], "%d", &level);
+ sscanf(argv[2], "%30d", &level);
switch (level) {
case 4:
diff --git a/res/res_features.c b/res/res_features.c
index 756733fc1..0add7bab9 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -2004,13 +2004,13 @@ static int load_config(void)
} else if (!strcasecmp(var->name, "context")) {
ast_copy_string(parking_con, var->value, sizeof(parking_con));
} else if (!strcasecmp(var->name, "parkingtime")) {
- if ((sscanf(var->value, "%d", &parkingtime) != 1) || (parkingtime < 1)) {
+ if ((sscanf(var->value, "%30d", &parkingtime) != 1) || (parkingtime < 1)) {
ast_log(LOG_WARNING, "%s is not a valid parkingtime\n", var->value);
parkingtime = DEFAULT_PARK_TIME;
} else
parkingtime = parkingtime * 1000;
} else if (!strcasecmp(var->name, "parkpos")) {
- if (sscanf(var->value, "%d-%d", &start, &end) != 2) {
+ if (sscanf(var->value, "%30d-%30d", &start, &end) != 2) {
ast_log(LOG_WARNING, "Format for parking positions is a-b, where a and b are numbers at line %d of parking.conf\n", var->lineno);
} else {
parking_start = start;
@@ -2021,13 +2021,13 @@ static int load_config(void)
} else if (!strcasecmp(var->name, "adsipark")) {
adsipark = ast_true(var->value);
} else if (!strcasecmp(var->name, "transferdigittimeout")) {
- if ((sscanf(var->value, "%d", &transferdigittimeout) != 1) || (transferdigittimeout < 1)) {
+ if ((sscanf(var->value, "%30d", &transferdigittimeout) != 1) || (transferdigittimeout < 1)) {
ast_log(LOG_WARNING, "%s is not a valid transferdigittimeout\n", var->value);
transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
} else
transferdigittimeout = transferdigittimeout * 1000;
} else if (!strcasecmp(var->name, "featuredigittimeout")) {
- if ((sscanf(var->value, "%d", &featuredigittimeout) != 1) || (featuredigittimeout < 1)) {
+ if ((sscanf(var->value, "%30d", &featuredigittimeout) != 1) || (featuredigittimeout < 1)) {
ast_log(LOG_WARNING, "%s is not a valid featuredigittimeout\n", var->value);
featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT;
}
diff --git a/res/res_osp.c b/res/res_osp.c
index 41ca8c0cf..f2aa60a0f 100644
--- a/res/res_osp.c
+++ b/res/res_osp.c
@@ -167,22 +167,22 @@ static int osp_build(struct ast_config *cfg, char *cat)
} else
ast_log(LOG_WARNING, "Too many Service points at line %d\n", v->lineno);
} else if (!strcasecmp(v->name, "maxconnections")) {
- if ((sscanf(v->value, "%d", &x) == 1) && (x > 0) && (x <= 1000)) {
+ if ((sscanf(v->value, "%30d", &x) == 1) && (x > 0) && (x <= 1000)) {
osp->maxconnections = x;
} else
ast_log(LOG_WARNING, "maxconnections should be an integer from 1 to 1000, not '%s' at line %d\n", v->value, v->lineno);
} else if (!strcasecmp(v->name, "retrydelay")) {
- if ((sscanf(v->value, "%d", &x) == 1) && (x >= 0) && (x <= 10)) {
+ if ((sscanf(v->value, "%30d", &x) == 1) && (x >= 0) && (x <= 10)) {
osp->retrydelay = x;
} else
ast_log(LOG_WARNING, "retrydelay should be an integer from 0 to 10, not '%s' at line %d\n", v->value, v->lineno);
} else if (!strcasecmp(v->name, "retrylimit")) {
- if ((sscanf(v->value, "%d", &x) == 1) && (x >= 0) && (x <= 100)) {
+ if ((sscanf(v->value, "%30d", &x) == 1) && (x >= 0) && (x <= 100)) {
osp->retrylimit = x;
} else
ast_log(LOG_WARNING, "retrylimit should be an integer from 0 to 100, not '%s' at line %d\n", v->value, v->lineno);
} else if (!strcasecmp(v->name, "timeout")) {
- if ((sscanf(v->value, "%d", &x) == 1) && (x >= 200) && (x <= 10000)) {
+ if ((sscanf(v->value, "%30d", &x) == 1) && (x >= 200) && (x <= 10000)) {
osp->timeout = x;
} else
ast_log(LOG_WARNING, "timeout should be an integer from 200 to 10000, not '%s' at line %d\n", v->value, v->lineno);
@@ -809,7 +809,7 @@ static int config_load(void)
}
cat = ast_variable_retrieve(cfg, "general", "tokenformat");
if (cat) {
- if ((sscanf(cat, "%d", &tokenformat) != 1) || (tokenformat < TOKEN_ALGO_SIGNED) || (tokenformat > TOKEN_ALGO_BOTH)) {
+ if ((sscanf(cat, "%30d", &tokenformat) != 1) || (tokenformat < TOKEN_ALGO_SIGNED) || (tokenformat > TOKEN_ALGO_BOTH)) {
tokenformat = TOKEN_ALGO_SIGNED;
ast_log(LOG_WARNING, "tokenformat should be an integer from 0 to 2, not '%s'\n", cat);
}