aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_cut.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-10 19:20:57 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-10 19:20:57 +0000
commitd1ec1aa57d296243d584ad268d8e61d7d1998569 (patch)
tree2596a6cb913ad8bd78e4670d298dc1d4682b2d23 /funcs/func_cut.c
parent4548c33d84f71a04a0416a26b9f0dea0ae061cc4 (diff)
AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211539 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_cut.c')
-rw-r--r--funcs/func_cut.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/funcs/func_cut.c b/funcs/func_cut.c
index c7eb6e5b9..10bca0a9f 100644
--- a/funcs/func_cut.c
+++ b/funcs/func_cut.c
@@ -129,7 +129,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++;
}
@@ -191,15 +191,15 @@ static int cut_internal(struct ast_channel *chan, char *data, struct ast_str **b
int start_field, stop_field;
char trashchar;
- if (sscanf(next_range, "%d-%d", &start_field, &stop_field) == 2) {
+ if (sscanf(next_range, "%30d-%30d", &start_field, &stop_field) == 2) {
/* range with both start and end */
- } else if (sscanf(next_range, "-%d", &stop_field) == 1) {
+ } else if (sscanf(next_range, "-%30d", &stop_field) == 1) {
/* range with end only */
start_field = 1;
- } else if ((sscanf(next_range, "%d%c", &start_field, &trashchar) == 2) && (trashchar == '-')) {
+ } else if ((sscanf(next_range, "%30d%1c", &start_field, &trashchar) == 2) && (trashchar == '-')) {
/* range with start only */
stop_field = INT_MAX;
- } else if (sscanf(next_range, "%d", &start_field) == 1) {
+ } else if (sscanf(next_range, "%30d", &start_field) == 1) {
/* single number */
stop_field = start_field;
} else {