aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-10 19:36:38 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-10 19:36:38 +0000
commitd69c554bf4ab96d713b9f58fb22ea449cfd5901b (patch)
tree72e9f08d12cb63bcead8c9313eb1bebdd41d5469 /pbx
parenta6751112c3f5effd6608e8fb9dc7afce7b64a05e (diff)
AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@211580 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_config.c8
-rw-r--r--pbx/pbx_dundi.c18
-rw-r--r--pbx/pbx_loopback.c2
-rw-r--r--pbx/pbx_spool.c10
4 files changed, 19 insertions, 19 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index 7f07549a6..3757a56cf 100644
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -947,7 +947,7 @@ static char *handle_cli_dialplan_add_extension(struct ast_cli_entry *e, int cmd,
if (!strcmp(prior, "hint")) {
iprior = PRIORITY_HINT;
} else {
- if (sscanf(prior, "%d", &iprior) != 1) {
+ if (sscanf(prior, "%30d", &iprior) != 1) {
ast_cli(a->fd, "'%s' is not a valid priority\n", prior);
prior = NULL;
}
@@ -1486,7 +1486,7 @@ process_extension:
} else {
ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n");
}
- } else if (sscanf(pri, "%d", &ipri) != 1 &&
+ } else if (sscanf(pri, "%30d", &ipri) != 1 &&
(ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) {
ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno);
ipri = 0;
@@ -1639,9 +1639,9 @@ static void pbx_load_users(void)
c = dahdicopy;
chan = strsep(&c, ",");
while (chan) {
- if (sscanf(chan, "%d-%d", &start, &finish) == 2) {
+ if (sscanf(chan, "%30d-%30d", &start, &finish) == 2) {
/* Range */
- } else if (sscanf(chan, "%d", &start)) {
+ } else if (sscanf(chan, "%30d", &start)) {
/* Just one */
finish = start;
} else {
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index f478b7768..5f2dc50fe 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -475,7 +475,7 @@ static int get_mapping_weight(struct dundi_mapping *map)
buf[0] = 0;
if (map->weightstr) {
pbx_substitute_variables_helper(NULL, map->weightstr, buf, sizeof(buf) - 1);
- if (sscanf(buf, "%d", &map->_weight) != 1)
+ if (sscanf(buf, "%30d", &map->_weight) != 1)
map->_weight = MAX_WEIGHT;
}
@@ -1088,7 +1088,7 @@ static int cache_lookup_internal(time_t now, struct dundi_request *req, char *ke
if (expiration > 0) {
ast_debug(1, "Found cache expiring in %d seconds!\n", expiration);
ptr += length + 1;
- while((sscanf(ptr, "%d/%d/%d/%n", &(flags.flags), &weight, &tech, &length) == 3)) {
+ while((sscanf(ptr, "%30d/%30d/%30d/%n", &(flags.flags), &weight, &tech, &length) == 3)) {
ptr += length;
term = strchr(ptr, '|');
if (term) {
@@ -4036,7 +4036,7 @@ static int dundi_result_read(struct ast_channel *chan, const char *cmd, char *da
goto finish;
}
- if (sscanf(args.resultnum, "%u", &num) != 1) {
+ if (sscanf(args.resultnum, "%30u", &num) != 1) {
ast_log(LOG_ERROR, "Invalid value '%s' for resultnum to DUNDIRESULT!\n",
args.resultnum);
goto finish;
@@ -4200,7 +4200,7 @@ static void build_mapping(const char *name, const char *value)
} else if (x >= 4) {
ast_copy_string(map->dcontext, name, sizeof(map->dcontext));
ast_copy_string(map->lcontext, fields[0], sizeof(map->lcontext));
- if ((sscanf(fields[1], "%d", &map->_weight) == 1) && (map->_weight >= 0) && (map->_weight <= MAX_WEIGHT)) {
+ if ((sscanf(fields[1], "%30d", &map->_weight) == 1) && (map->_weight >= 0) && (map->_weight <= MAX_WEIGHT)) {
ast_copy_string(map->dest, fields[3], sizeof(map->dest));
if ((map->tech = str2tech(fields[2])))
map->dead = 0;
@@ -4302,7 +4302,7 @@ static void populate_addr(struct dundi_peer *peer, dundi_eid *eid)
if (c) {
*c = '\0';
c++;
- if (sscanf(c, "%d:%d", &port, &expire) == 2) {
+ if (sscanf(c, "%5d:%30d", &port, &expire) == 2) {
/* Got it! */
inet_aton(data, &peer->addr.sin_addr);
peer->addr.sin_family = AF_INET;
@@ -4399,7 +4399,7 @@ static void build_peer(dundi_eid *eid, struct ast_variable *v, int *globalpcmode
peer->maxms = 0;
} else if (!strcasecmp(v->value, "yes")) {
peer->maxms = DEFAULT_MAXMS;
- } else if (sscanf(v->value, "%d", &peer->maxms) != 1) {
+ } else if (sscanf(v->value, "%30d", &peer->maxms) != 1) {
ast_log(LOG_WARNING, "Qualification of peer '%s' should be 'yes', 'no', or a number of milliseconds at line %d of dundi.conf\n",
ast_eid_to_str(eid_str, sizeof(eid_str), &peer->eid), v->lineno);
peer->maxms = 0;
@@ -4637,14 +4637,14 @@ static int set_config(char *config_file, struct sockaddr_in* sin, int reload)
} else if (!strcasecmp(v->name, "authdebug")) {
authdebug = ast_true(v->value);
} else if (!strcasecmp(v->name, "ttl")) {
- if ((sscanf(v->value, "%d", &x) == 1) && (x > 0) && (x < DUNDI_DEFAULT_TTL)) {
+ if ((sscanf(v->value, "%30d", &x) == 1) && (x > 0) && (x < DUNDI_DEFAULT_TTL)) {
dundi_ttl = x;
} else {
ast_log(LOG_WARNING, "'%s' is not a valid TTL at line %d, must be number from 1 to %d\n",
v->value, v->lineno, DUNDI_DEFAULT_TTL);
}
} else if (!strcasecmp(v->name, "autokill")) {
- if (sscanf(v->value, "%d", &x) == 1) {
+ if (sscanf(v->value, "%30d", &x) == 1) {
if (x >= 0)
global_autokilltimeout = x;
else
@@ -4679,7 +4679,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin, int reload)
} else if (!strcasecmp(v->name, "storehistory")) {
global_storehistory = ast_true(v->value);
} else if (!strcasecmp(v->name, "cachetime")) {
- if ((sscanf(v->value, "%d", &x) == 1)) {
+ if ((sscanf(v->value, "%30d", &x) == 1)) {
dundi_cache_time = x;
} else {
ast_log(LOG_WARNING, "'%s' is not a valid cache time at line %d. Using default value '%d'.\n",
diff --git a/pbx/pbx_loopback.c b/pbx/pbx_loopback.c
index e9001deef..f51ec8204 100644
--- a/pbx/pbx_loopback.c
+++ b/pbx/pbx_loopback.c
@@ -120,7 +120,7 @@ static void loopback_parse(char **newexten, char **newcontext, int *priority, ch
if (!ast_strlen_zero(con))
*newcontext = con;
if (!ast_strlen_zero(pri))
- sscanf(pri, "%d", priority);
+ sscanf(pri, "%30d", priority);
}
static int loopback_exists(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index 4b1b33e97..f6d1ec3a0 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -172,7 +172,7 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
} else if (!strcasecmp(buf, "data")) {
ast_string_field_set(o, data, c);
} else if (!strcasecmp(buf, "maxretries")) {
- if (sscanf(c, "%d", &o->maxretries) != 1) {
+ if (sscanf(c, "%30d", &o->maxretries) != 1) {
ast_log(LOG_WARNING, "Invalid max retries at line %d of %s\n", lineno, fn);
o->maxretries = 0;
}
@@ -183,24 +183,24 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
} else if (!strcasecmp(buf, "extension")) {
ast_string_field_set(o, exten, c);
} else if (!strcasecmp(buf, "priority")) {
- if ((sscanf(c, "%d", &o->priority) != 1) || (o->priority < 1)) {
+ if ((sscanf(c, "%30d", &o->priority) != 1) || (o->priority < 1)) {
ast_log(LOG_WARNING, "Invalid priority at line %d of %s\n", lineno, fn);
o->priority = 1;
}
} else if (!strcasecmp(buf, "retrytime")) {
- if ((sscanf(c, "%d", &o->retrytime) != 1) || (o->retrytime < 1)) {
+ if ((sscanf(c, "%30d", &o->retrytime) != 1) || (o->retrytime < 1)) {
ast_log(LOG_WARNING, "Invalid retrytime at line %d of %s\n", lineno, fn);
o->retrytime = 300;
}
} else if (!strcasecmp(buf, "waittime")) {
- if ((sscanf(c, "%d", &o->waittime) != 1) || (o->waittime < 1)) {
+ if ((sscanf(c, "%30d", &o->waittime) != 1) || (o->waittime < 1)) {
ast_log(LOG_WARNING, "Invalid waittime at line %d of %s\n", lineno, fn);
o->waittime = 45;
}
} else if (!strcasecmp(buf, "retry")) {
o->retries++;
} else if (!strcasecmp(buf, "startretry")) {
- if (sscanf(c, "%ld", &o->callingpid) != 1) {
+ if (sscanf(c, "%30ld", &o->callingpid) != 1) {
ast_log(LOG_WARNING, "Unable to retrieve calling PID!\n");
o->callingpid = 0;
}