diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:30:55 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:30:55 +0000 |
commit | 0a58b6f090e35416038b228aba00cad23499770d (patch) | |
tree | b3527de796ac80b2f4fcdb132f2d270c8f1b05cc /pbx | |
parent | f53a0bbe56fc4b41f96aad790f8de69f544d7b8f (diff) |
AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@211569 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r-- | pbx/dundi-parser.c | 2 | ||||
-rw-r--r-- | pbx/pbx_config.c | 8 | ||||
-rw-r--r-- | pbx/pbx_dundi.c | 18 | ||||
-rw-r--r-- | pbx/pbx_loopback.c | 2 | ||||
-rw-r--r-- | pbx/pbx_spool.c | 10 |
5 files changed, 20 insertions, 20 deletions
diff --git a/pbx/dundi-parser.c b/pbx/dundi-parser.c index 15dae84d6..3a8396110 100644 --- a/pbx/dundi-parser.c +++ b/pbx/dundi-parser.c @@ -70,7 +70,7 @@ int dundi_str_short_to_eid(dundi_eid *eid, const char *s) int x; if (sscanf(s, "%2x%2x%2x%2x%2x%2x", &eid_int[0], &eid_int[1], &eid_int[2], &eid_int[3], &eid_int[4], &eid_int[5]) != 6) - return -1; + return -1; for (x = 0; x < 6; x++) eid->eid[x] = eid_int[x]; return 0; diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index e3382a2f1..4ff5d1fe3 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; } @@ -1438,7 +1438,7 @@ static int pbx_load_config(const char *config_file) ipri = lastpri; 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; @@ -1566,9 +1566,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 4d1737673..cab456172 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) { @@ -4088,7 +4088,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; @@ -4252,7 +4252,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; @@ -4354,7 +4354,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; @@ -4451,7 +4451,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; @@ -4690,14 +4690,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 @@ -4732,7 +4732,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 64c176769..34010e752 100644 --- a/pbx/pbx_spool.c +++ b/pbx/pbx_spool.c @@ -171,7 +171,7 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f) } else if (!strcasecmp(buf, "data")) { ast_copy_string(o->data, c, sizeof(o->data)); } 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; } @@ -182,24 +182,24 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f) } else if (!strcasecmp(buf, "extension")) { ast_copy_string(o->exten, c, sizeof(o->exten)); } 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; } |