aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-10 19:30:55 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-10 19:30:55 +0000
commit0a58b6f090e35416038b228aba00cad23499770d (patch)
treeb3527de796ac80b2f4fcdb132f2d270c8f1b05cc /funcs
parentf53a0bbe56fc4b41f96aad790f8de69f544d7b8f (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 'funcs')
-rw-r--r--funcs/func_channel.c4
-rw-r--r--funcs/func_cut.c10
-rw-r--r--funcs/func_dialplan.c2
-rw-r--r--funcs/func_enum.c2
-rw-r--r--funcs/func_math.c4
-rw-r--r--funcs/func_odbc.c2
-rw-r--r--funcs/func_rand.c4
-rw-r--r--funcs/func_speex.c2
-rw-r--r--funcs/func_strings.c4
-rw-r--r--funcs/func_timeout.c2
10 files changed, 18 insertions, 18 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 84d115a73..84a0d48d8 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -143,10 +143,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 54893a9bf..aacb20579 100644
--- a/funcs/func_enum.c
+++ b/funcs/func_enum.c
@@ -262,7 +262,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 3517b16ed..9179ff743 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 e093ecffc..129a1b8ef 100644
--- a/funcs/func_odbc.c
+++ b/funcs/func_odbc.c
@@ -711,7 +711,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_speex.c b/funcs/func_speex.c
index 4ddfab80b..39deabd0c 100644
--- a/funcs/func_speex.c
+++ b/funcs/func_speex.c
@@ -193,7 +193,7 @@ static int speex_write(struct ast_channel *chan, const char *cmd, char *data, co
}
if (!strcasecmp(cmd, "agc")) {
- if (!sscanf(value, "%f", &(*sdi)->agclevel))
+ if (!sscanf(value, "%30f", &(*sdi)->agclevel))
(*sdi)->agclevel = ast_true(value) ? DEFAULT_AGC_LEVEL : 0.0;
if ((*sdi)->agclevel > 32768.0) {
diff --git a/funcs/func_strings.c b/funcs/func_strings.c
index 1cd55739e..1af4ed05f 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;
}
diff --git a/funcs/func_timeout.c b/funcs/func_timeout.c
index c54830358..d332c9df4 100644
--- a/funcs/func_timeout.c
+++ b/funcs/func_timeout.c
@@ -101,7 +101,7 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
if (!value)
return -1;
- res = sscanf(value, "%ld%lf", &sec, &x);
+ res = sscanf(value, "%30ld%30lf", &sec, &x);
if (res == 0 || sec < 0) {
when.tv_sec = 0;
when.tv_usec = 0;