diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:15:57 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:15:57 +0000 |
commit | 8cae492343324ae845b8b19d78b253d824eac10f (patch) | |
tree | 3d0ab9b89a652c8bde68776be0e8b945b81aaa6b /res | |
parent | 9f4c1d7a4e1ee5f0ea1b21af53eb7357366ff661 (diff) |
AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@211528 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 24 | ||||
-rw-r--r-- | res/res_features.c | 14 | ||||
-rw-r--r-- | res/res_odbc.c | 8 | ||||
-rw-r--r-- | res/res_smdi.c | 8 |
4 files changed, 27 insertions, 27 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index 15ecaa516..fe53ebe68 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -448,7 +448,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); @@ -558,7 +558,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])) @@ -599,7 +599,7 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, char if (argv[3]) edigits = argv[3]; - 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); @@ -720,7 +720,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) @@ -736,7 +736,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); @@ -766,7 +766,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) @@ -781,7 +781,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) @@ -892,7 +892,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; } @@ -924,7 +924,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) @@ -965,7 +965,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], '='))) @@ -1085,7 +1085,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; @@ -1259,7 +1259,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 b148bb71d..1813268fd 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -367,7 +367,7 @@ static struct parkeduser *park_space_reserve(struct ast_channel *chan) * limitation here. If extout was not numeric, we could permit * arbitrary non-numeric extensions. */ - if (sscanf(parkingexten, "%d", &parking_space) != 1 || parking_space < 0) { + if (sscanf(parkingexten, "%30d", &parking_space) != 1 || parking_space < 0) { ast_log(LOG_WARNING, "PARKINGEXTEN does not indicate a valid parking slot: '%s'.\n", parkingexten); ast_mutex_unlock(&parking_lock); free(pu); @@ -2787,7 +2787,7 @@ static int manager_park(struct mansession *s, const struct message *m) } if (!ast_strlen_zero(timeout)) { - sscanf(timeout, "%d", &to); + sscanf(timeout, "%30d", &to); } res = ast_masq_park_call(ch1, ch2, to, &parkExt); @@ -2904,13 +2904,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 features.conf\n", var->lineno); } else { parking_start = start; @@ -2959,18 +2959,18 @@ 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; } } else if (!strcasecmp(var->name, "atxfernoanswertimeout")) { - if ((sscanf(var->value, "%d", &atxfernoanswertimeout) != 1) || (atxfernoanswertimeout < 1)) { + if ((sscanf(var->value, "%30d", &atxfernoanswertimeout) != 1) || (atxfernoanswertimeout < 1)) { ast_log(LOG_WARNING, "%s is not a valid atxfernoanswertimeout\n", var->value); atxfernoanswertimeout = DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER; } else diff --git a/res/res_odbc.c b/res/res_odbc.c index be174aab1..961e30044 100644 --- a/res/res_odbc.c +++ b/res/res_odbc.c @@ -247,7 +247,7 @@ static int load_odbc_config(void) if (ast_true(v->value)) pooling = 1; } else if (!strcasecmp(v->name, "limit")) { - sscanf(v->value, "%d", &limit); + sscanf(v->value, "%4d", &limit); if (ast_true(v->value) && !limit) { ast_log(LOG_WARNING, "Limit should be a number, not a boolean: '%s'. Setting limit to 1023 for ODBC class '%s'.\n", v->value, cat); limit = 1023; @@ -261,7 +261,7 @@ static int load_odbc_config(void) limit = 1023; } } else if (!strcasecmp(v->name, "idlecheck")) { - sscanf(v->value, "%d", &idlecheck); + sscanf(v->value, "%30u", &idlecheck); } else if (!strcasecmp(v->name, "enabled")) { enabled = ast_true(v->value); } else if (!strcasecmp(v->name, "pre-connect")) { @@ -610,7 +610,7 @@ static int reload(void) if (!strcasecmp(v->name, "pooling")) { pooling = 1; } else if (!strcasecmp(v->name, "limit")) { - sscanf(v->value, "%d", &limit); + sscanf(v->value, "%4d", &limit); if (ast_true(v->value) && !limit) { ast_log(LOG_WARNING, "Limit should be a number, not a boolean: '%s'. Setting limit to 1023 for ODBC class '%s'.\n", v->value, cat); limit = 1023; @@ -620,7 +620,7 @@ static int reload(void) break; } } else if (!strcasecmp(v->name, "idlecheck")) { - sscanf(v->value, "%ud", &idlecheck); + sscanf(v->value, "%30u", &idlecheck); } else if (!strcasecmp(v->name, "enabled")) { enabled = ast_true(v->value); } else if (!strcasecmp(v->name, "pre-connect")) { diff --git a/res/res_smdi.c b/res/res_smdi.c index f26e2ac25..55179d78d 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -910,7 +910,7 @@ static int smdi_load(int reload) baud_rate = B9600; } } else if (!strcasecmp(v->name, "msdstrip")) { - if (!sscanf(v->value, "%d", &msdstrip)) { + if (!sscanf(v->value, "%30d", &msdstrip)) { ast_log(LOG_NOTICE, "Invalid msdstrip value in %s (line %d), using default\n", config_file, v->lineno); msdstrip = 0; } else if (0 > msdstrip || msdstrip > 9) { @@ -918,7 +918,7 @@ static int smdi_load(int reload) msdstrip = 0; } } else if (!strcasecmp(v->name, "msgexpirytime")) { - if (!sscanf(v->value, "%ld", &msg_expiry)) { + if (!sscanf(v->value, "%30ld", &msg_expiry)) { ast_log(LOG_NOTICE, "Invalid msgexpirytime value in %s (line %d), using default\n", config_file, v->lineno); msg_expiry = SMDI_MSG_EXPIRY_TIME; } @@ -1052,7 +1052,7 @@ static int smdi_load(int reload) continue; } } else if (!strcasecmp(v->name, "pollinginterval")) { - if (sscanf(v->value, "%u", &mwi_monitor.polling_interval) != 1) { + if (sscanf(v->value, "%30u", &mwi_monitor.polling_interval) != 1) { ast_log(LOG_ERROR, "Invalid value for pollinginterval: %s\n", v->value); mwi_monitor.polling_interval = DEFAULT_POLLING_INTERVAL; } @@ -1173,7 +1173,7 @@ static int smdi_msg_retrieve_read(struct ast_channel *chan, char *cmd, char *dat } if (!ast_strlen_zero(args.timeout)) { - if (sscanf(args.timeout, "%u", &timeout) != 1) { + if (sscanf(args.timeout, "%30u", &timeout) != 1) { ast_log(LOG_ERROR, "'%s' is not a valid timeout\n", args.timeout); timeout = SMDI_RETRIEVE_TIMEOUT_DEFAULT; } |