mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-06 18:03:34 +00:00
AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@211569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
14
main/pbx.c
14
main/pbx.c
@@ -2388,7 +2388,7 @@ static int parse_variable_name(char *var, int *offset, int *length, int *isfunc)
|
||||
parens--;
|
||||
} else if (*var == ':' && parens == 0) {
|
||||
*var++ = '\0';
|
||||
sscanf(var, "%d:%d", offset, length);
|
||||
sscanf(var, "%30d:%30d", offset, length);
|
||||
return 1; /* offset:length valid */
|
||||
}
|
||||
}
|
||||
@@ -6220,7 +6220,7 @@ static int lookup_name(const char *s, char *const names[], int max)
|
||||
if (!strcasecmp(s, names[i]))
|
||||
return i+1;
|
||||
}
|
||||
} else if (sscanf(s, "%d", &i) == 1 && i >= 1 && i <= max) {
|
||||
} else if (sscanf(s, "%2d", &i) == 1 && i >= 1 && i <= max) {
|
||||
return i;
|
||||
}
|
||||
return 0; /* error return */
|
||||
@@ -6307,11 +6307,11 @@ static void get_timerange(struct ast_timing *i, char *times)
|
||||
ast_log(LOG_WARNING, "Invalid time range. Assuming no restrictions based on time.\n");
|
||||
return;
|
||||
}
|
||||
if (sscanf(times, "%d:%d", &s1, &s2) != 2) {
|
||||
if (sscanf(times, "%2d:%2d", &s1, &s2) != 2) {
|
||||
ast_log(LOG_WARNING, "%s isn't a time. Assuming no restrictions based on time.\n", times);
|
||||
return;
|
||||
}
|
||||
if (sscanf(e, "%d:%d", &e1, &e2) != 2) {
|
||||
if (sscanf(e, "%2d:%2d", &e1, &e2) != 2) {
|
||||
ast_log(LOG_WARNING, "%s isn't a time. Assuming no restrictions based on time.\n", e);
|
||||
return;
|
||||
}
|
||||
@@ -7850,7 +7850,7 @@ static void wait_for_hangup(struct ast_channel *chan, void *data)
|
||||
double waitsec;
|
||||
int waittime;
|
||||
|
||||
if (ast_strlen_zero(data) || (sscanf(data, "%lg", &waitsec) != 1) || (waitsec < 0))
|
||||
if (ast_strlen_zero(data) || (sscanf(data, "%30lg", &waitsec) != 1) || (waitsec < 0))
|
||||
waitsec = -1;
|
||||
if (waitsec > -1) {
|
||||
waittime = waitsec * 1000.0;
|
||||
@@ -8578,7 +8578,7 @@ int pbx_checkcondition(const char *condition)
|
||||
int res;
|
||||
if (ast_strlen_zero(condition)) { /* NULL or empty strings are false */
|
||||
return 0;
|
||||
} else if (sscanf(condition, "%d", &res) == 1) { /* Numbers are evaluated for truth */
|
||||
} else if (sscanf(condition, "%30d", &res) == 1) { /* Numbers are evaluated for truth */
|
||||
return res;
|
||||
} else { /* Strings are true */
|
||||
return 1;
|
||||
@@ -8992,7 +8992,7 @@ static int pbx_parseable_goto(struct ast_channel *chan, const char *goto_string,
|
||||
mode = -1;
|
||||
pri++;
|
||||
}
|
||||
if (sscanf(pri, "%d", &ipri) != 1) {
|
||||
if (sscanf(pri, "%30d", &ipri) != 1) {
|
||||
if ((ipri = ast_findlabel_extension(chan, context ? context : chan->context, exten ? exten : chan->exten,
|
||||
pri, chan->cid.cid_num)) < 1) {
|
||||
ast_log(LOG_WARNING, "Priority '%s' must be a number > 0, or valid label\n", pri);
|
||||
|
||||
Reference in New Issue
Block a user