diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:25:03 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:25:03 +0000 |
commit | dbef80dfa2752f6306e45af841d5573ccfd14f03 (patch) | |
tree | 638d77074098ba848a915b044a9c6b4d12efb4ca /funcs | |
parent | 55ecd87dff70a3ca8ff715adae8d95b68c238e26 (diff) |
AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@211551 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_channel.c | 4 | ||||
-rw-r--r-- | funcs/func_cut.c | 10 | ||||
-rw-r--r-- | funcs/func_dialplan.c | 2 | ||||
-rw-r--r-- | funcs/func_enum.c | 2 | ||||
-rw-r--r-- | funcs/func_math.c | 4 | ||||
-rw-r--r-- | funcs/func_odbc.c | 2 | ||||
-rw-r--r-- | funcs/func_rand.c | 4 | ||||
-rw-r--r-- | funcs/func_strings.c | 4 |
8 files changed, 16 insertions, 16 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c index 1cb63393d..b30ba5cb5 100644 --- a/funcs/func_channel.c +++ b/funcs/func_channel.c @@ -136,10 +136,10 @@ static int func_channel_write(struct ast_channel *chan, const char *function, } else if (!strcasecmp(data, "callgroup")) chan->callgroup = ast_get_group(value); else if (!strcasecmp(data, "txgain")) { - sscanf(value, "%hhd", &gainset); + sscanf(value, "%4hhd", &gainset); ast_channel_setoption(chan, AST_OPTION_TXGAIN, &gainset, sizeof(gainset), 0); } else if (!strcasecmp(data, "rxgain")) { - sscanf(value, "%hhd", &gainset); + sscanf(value, "%4hhd", &gainset); ast_channel_setoption(chan, AST_OPTION_RXGAIN, &gainset, sizeof(gainset), 0); } else if (!strcasecmp(data, "transfercapability")) { unsigned short i; diff --git a/funcs/func_cut.c b/funcs/func_cut.c index eace3ecd4..787dfe95f 100644 --- a/funcs/func_cut.c +++ b/funcs/func_cut.c @@ -89,7 +89,7 @@ static int sort_internal(struct ast_channel *chan, char *data, char *buffer, siz } *ptrvalue++ = '\0'; sortable_keys[count2].key = ptrkey; - sscanf(ptrvalue, "%f", &sortable_keys[count2].value); + sscanf(ptrvalue, "%30f", &sortable_keys[count2].value); count2++; } @@ -153,15 +153,15 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size int num1 = 0, num2 = MAXRESULT; char trashchar; - if (sscanf(nextgroup, "%d-%d", &num1, &num2) == 2) { + if (sscanf(nextgroup, "%30d-%30d", &num1, &num2) == 2) { /* range with both start and end */ - } else if (sscanf(nextgroup, "-%d", &num2) == 1) { + } else if (sscanf(nextgroup, "-%30d", &num2) == 1) { /* range with end */ num1 = 0; - } else if ((sscanf(nextgroup, "%d%c", &num1, &trashchar) == 2) && (trashchar == '-')) { + } else if ((sscanf(nextgroup, "%30d%1c", &num1, &trashchar) == 2) && (trashchar == '-')) { /* range with start */ num2 = MAXRESULT; - } else if (sscanf(nextgroup, "%d", &num1) == 1) { + } else if (sscanf(nextgroup, "%30d", &num1) == 1) { /* single number */ num2 = num1; } else { diff --git a/funcs/func_dialplan.c b/funcs/func_dialplan.c index 6d4c488f6..766b3c4c4 100644 --- a/funcs/func_dialplan.c +++ b/funcs/func_dialplan.c @@ -55,7 +55,7 @@ static int isexten_function_read(struct ast_channel *chan, const char *cmd, char if (!ast_strlen_zero(args.priority)) { int priority_num; - if (sscanf(args.priority, "%d", &priority_num) == 1 && priority_num > 0) { + if (sscanf(args.priority, "%30d", &priority_num) == 1 && priority_num > 0) { int res; res = ast_exists_extension(chan, args.context, args.exten, priority_num, chan->cid.cid_num); diff --git a/funcs/func_enum.c b/funcs/func_enum.c index e1c29cbfc..afeba457b 100644 --- a/funcs/func_enum.c +++ b/funcs/func_enum.c @@ -258,7 +258,7 @@ static int enum_result_read(struct ast_channel *chan, const char *cmd, char *dat 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 ENUMRESULT!\n", args.resultnum); goto finish; } diff --git a/funcs/func_math.c b/funcs/func_math.c index 45036d5ad..663cc5daf 100644 --- a/funcs/func_math.c +++ b/funcs/func_math.c @@ -190,12 +190,12 @@ static int math(struct ast_channel *chan, const char *cmd, char *parse, return -1; } - if (sscanf(mvalue1, "%lf", &fnum1) != 1) { + if (sscanf(mvalue1, "%30lf", &fnum1) != 1) { ast_log(LOG_WARNING, "'%s' is not a valid number\n", mvalue1); return -1; } - if (sscanf(mvalue2, "%lf", &fnum2) != 1) { + if (sscanf(mvalue2, "%30lf", &fnum2) != 1) { ast_log(LOG_WARNING, "'%s' is not a valid number\n", mvalue2); return -1; } diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c index c8e8760e6..a7c747ada 100644 --- a/funcs/func_odbc.c +++ b/funcs/func_odbc.c @@ -671,7 +671,7 @@ static int init_acf_query(struct ast_config *cfg, char *catg, struct acf_odbc_qu if (strcasecmp(tmp, "multirow") == 0) ast_set_flag((*query), OPT_MULTIROW); if ((tmp = ast_variable_retrieve(cfg, catg, "rowlimit"))) - sscanf(tmp, "%d", &((*query)->rowlimit)); + sscanf(tmp, "%30d", &((*query)->rowlimit)); } (*query)->acf = ast_calloc(1, sizeof(struct ast_custom_function)); diff --git a/funcs/func_rand.c b/funcs/func_rand.c index a3db21d26..57bd30fe9 100644 --- a/funcs/func_rand.c +++ b/funcs/func_rand.c @@ -45,10 +45,10 @@ static int acf_rand_exec(struct ast_channel *chan, const char *cmd, AST_STANDARD_APP_ARGS(args, parse); - if (ast_strlen_zero(args.min) || sscanf(args.min, "%d", &min_int) != 1) + if (ast_strlen_zero(args.min) || sscanf(args.min, "%30d", &min_int) != 1) min_int = 0; - if (ast_strlen_zero(args.max) || sscanf(args.max, "%d", &max_int) != 1) + if (ast_strlen_zero(args.max) || sscanf(args.max, "%30d", &max_int) != 1) max_int = RAND_MAX; if (max_int < min_int) { diff --git a/funcs/func_strings.c b/funcs/func_strings.c index f2be6f560..f0fd9cc61 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -485,7 +485,7 @@ static int acf_sprintf(struct ast_channel *chan, const char *cmd, char *data, ch /* Convert the argument into the required type */ if (arg.var[argcount]) { - if (sscanf(arg.var[argcount++], "%d", &tmpi) != 1) { + if (sscanf(arg.var[argcount++], "%30d", &tmpi) != 1) { ast_log(LOG_ERROR, "Argument '%s' is not an integer number for format '%s'\n", arg.var[argcount - 1], formatbuf); goto sprintf_fail; } @@ -508,7 +508,7 @@ static int acf_sprintf(struct ast_channel *chan, const char *cmd, char *data, ch /* Convert the argument into the required type */ if (arg.var[argcount]) { - if (sscanf(arg.var[argcount++], "%lf", &tmpd) != 1) { + if (sscanf(arg.var[argcount++], "%30lf", &tmpd) != 1) { ast_log(LOG_ERROR, "Argument '%s' is not a floating point number for format '%s'\n", arg.var[argcount - 1], formatbuf); goto sprintf_fail; } |