aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 58de082b7..fafaa9796 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -8443,7 +8443,7 @@ static unsigned int parse_pointcode(const char *pcstring)
unsigned int code1, code2, code3;
int numvals;
- numvals = sscanf(pcstring, "%d-%d-%d", &code1, &code2, &code3);
+ numvals = sscanf(pcstring, "%30d-%30d-%30d", &code1, &code2, &code3);
if (numvals == 1)
return code1;
if (numvals == 3)
@@ -9268,7 +9268,7 @@ static struct ast_channel *dahdi_request(const char *type, int format, void *dat
stringp = dest + 1;
s = strsep(&stringp, "/");
- if ((res = sscanf(s, "%d%c%d", &x, &opt, &y)) < 1) {
+ if ((res = sscanf(s, "%30d%1c%30d", &x, &opt, &y)) < 1) {
ast_log(LOG_WARNING, "Unable to determine group for data %s\n", (char *)data);
return NULL;
}
@@ -9304,7 +9304,7 @@ static struct ast_channel *dahdi_request(const char *type, int format, void *dat
channelmatch = x;
}
#ifdef HAVE_PRI
- else if ((res = sscanf(s, "%d:%d%c%d", &trunkgroup, &crv, &opt, &y)) > 1) {
+ else if ((res = sscanf(s, "%30d:%30d%1c%30d", &trunkgroup, &crv, &opt, &y)) > 1) {
if ((trunkgroup < 1) || (crv < 1)) {
ast_log(LOG_WARNING, "Unable to determine trunk group and CRV for data %s\n", (char *)data);
return NULL;
@@ -9326,8 +9326,8 @@ static struct ast_channel *dahdi_request(const char *type, int format, void *dat
channelmatch = crv;
p = pris[x].crvs;
}
-#endif
- else if ((res = sscanf(s, "%d%c%d", &x, &opt, &y)) < 1) {
+#endif
+ else if ((res = sscanf(s, "%30d%1c%30d", &x, &opt, &y)) < 1) {
ast_log(LOG_WARNING, "Unable to determine channel for data %s\n", (char *)data);
return NULL;
} else {
@@ -12512,7 +12512,7 @@ static char *dahdi_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli
return CLI_SHOWUSAGE;
#ifdef HAVE_PRI
if ((c = strchr(a->argv[3], ':'))) {
- if (sscanf(a->argv[3], "%d:%d", &trunkgroup, &channel) != 2)
+ if (sscanf(a->argv[3], "%30d:%30d", &trunkgroup, &channel) != 2)
return CLI_SHOWUSAGE;
if ((trunkgroup < 1) || (channel < 1))
return CLI_SHOWUSAGE;
@@ -13787,7 +13787,7 @@ static int build_channels(struct dahdi_chan_conf *conf, int iscrv, const char *v
#ifdef HAVE_PRI
pri = NULL;
if (iscrv) {
- if (sscanf(c, "%d:%n", &trunkgroup, &y) != 1) {
+ if (sscanf(c, "%30d:%n", &trunkgroup, &y) != 1) {
ast_log(LOG_WARNING, "CRV must begin with trunkgroup followed by a colon at line %d.\n", lineno);
return -1;
}
@@ -13810,9 +13810,9 @@ static int build_channels(struct dahdi_chan_conf *conf, int iscrv, const char *v
#endif
while ((chan = strsep(&c, ","))) {
- if (sscanf(chan, "%d-%d", &start, &finish) == 2) {
+ if (sscanf(chan, "%30d-%30d", &start, &finish) == 2) {
/* Range */
- } else if (sscanf(chan, "%d", &start)) {
+ } else if (sscanf(chan, "%30d", &start)) {
/* Just one */
finish = start;
} else if (!strcasecmp(chan, "pseudo")) {
@@ -13901,7 +13901,7 @@ static void process_echocancel(struct dahdi_chan_conf *confp, const char *data,
strcpy(confp->chan.echocancel.params[confp->chan.echocancel.head.param_count].name, param.name);
if (param.value) {
- if (sscanf(param.value, "%d", &confp->chan.echocancel.params[confp->chan.echocancel.head.param_count].value) != 1) {
+ if (sscanf(param.value, "%30d", &confp->chan.echocancel.params[confp->chan.echocancel.head.param_count].value) != 1) {
ast_log(LOG_WARNING, "Invalid echocancel parameter value supplied at line %d: '%s'\n", line, param.value);
continue;
}
@@ -13938,7 +13938,7 @@ static int process_dahdi(struct dahdi_chan_conf *confp, struct ast_variable *v,
int res;
char policy[21] = "";
- res = sscanf(v->value, "%d,%20s", &confp->chan.buf_no, policy);
+ res = sscanf(v->value, "%30d,%20s", &confp->chan.buf_no, policy);
if (res != 2) {
ast_log(LOG_WARNING, "Parsing buffers option data failed, using defaults.\n");
confp->chan.buf_no = numbufs;
@@ -13972,11 +13972,11 @@ static int process_dahdi(struct dahdi_chan_conf *confp, struct ast_variable *v,
} else if (!strcasecmp(v->name, "dring3range")) {
confp->chan.drings.ringnum[2].range = atoi(v->value);
} else if (!strcasecmp(v->name, "dring1")) {
- sscanf(v->value, "%d,%d,%d", &confp->chan.drings.ringnum[0].ring[0], &confp->chan.drings.ringnum[0].ring[1], &confp->chan.drings.ringnum[0].ring[2]);
+ sscanf(v->value, "%30d,%30d,%30d", &confp->chan.drings.ringnum[0].ring[0], &confp->chan.drings.ringnum[0].ring[1], &confp->chan.drings.ringnum[0].ring[2]);
} else if (!strcasecmp(v->name, "dring2")) {
- sscanf(v->value,"%d,%d,%d", &confp->chan.drings.ringnum[1].ring[0], &confp->chan.drings.ringnum[1].ring[1], &confp->chan.drings.ringnum[1].ring[2]);
+ sscanf(v->value, "%30d,%30d,%30d", &confp->chan.drings.ringnum[1].ring[0], &confp->chan.drings.ringnum[1].ring[1], &confp->chan.drings.ringnum[1].ring[2]);
} else if (!strcasecmp(v->name, "dring3")) {
- sscanf(v->value, "%d,%d,%d", &confp->chan.drings.ringnum[2].ring[0], &confp->chan.drings.ringnum[2].ring[1], &confp->chan.drings.ringnum[2].ring[2]);
+ sscanf(v->value, "%30d,%30d,%30d", &confp->chan.drings.ringnum[2].ring[0], &confp->chan.drings.ringnum[2].ring[1], &confp->chan.drings.ringnum[2].ring[2]);
} else if (!strcasecmp(v->name, "usecallerid")) {
confp->chan.use_callerid = ast_true(v->value);
} else if (!strcasecmp(v->name, "cidsignalling")) {
@@ -14029,7 +14029,7 @@ static int process_dahdi(struct dahdi_chan_conf *confp, struct ast_variable *v,
} else if (!strcasecmp(v->name, "busycount")) {
confp->chan.busycount = atoi(v->value);
} else if (!strcasecmp(v->name, "busypattern")) {
- if (sscanf(v->value, "%d,%d", &confp->chan.busy_tonelength, &confp->chan.busy_quietlength) != 2) {
+ if (sscanf(v->value, "%30d,%30d", &confp->chan.busy_tonelength, &confp->chan.busy_quietlength) != 2) {
ast_log(LOG_ERROR, "busypattern= expects busypattern=tonelength,quietlength at line %d.\n", v->lineno);
}
} else if (!strcasecmp(v->name, "callprogress")) {
@@ -14047,7 +14047,7 @@ static int process_dahdi(struct dahdi_chan_conf *confp, struct ast_variable *v,
} else if (!strcasecmp(v->name, "echocancel")) {
process_echocancel(confp, v->value, v->lineno);
} else if (!strcasecmp(v->name, "echotraining")) {
- if (sscanf(v->value, "%d", &y) == 1) {
+ if (sscanf(v->value, "%30d", &y) == 1) {
if ((y < 10) || (y > 4000)) {
ast_log(LOG_WARNING, "Echo training time must be within the range of 10 to 4000 ms at line %d.\n", v->lineno);
} else {
@@ -14123,19 +14123,19 @@ static int process_dahdi(struct dahdi_chan_conf *confp, struct ast_variable *v,
confp->chan.mwimonitor_fsk = ast_true(v->value) ? 1 : 0;
}
} else if (!strcasecmp(v->name, "cid_rxgain")) {
- if (sscanf(v->value, "%f", &confp->chan.cid_rxgain) != 1) {
+ if (sscanf(v->value, "%30f", &confp->chan.cid_rxgain) != 1) {
ast_log(LOG_WARNING, "Invalid cid_rxgain: %s at line %d.\n", v->value, v->lineno);
}
} else if (!strcasecmp(v->name, "rxgain")) {
- if (sscanf(v->value, "%f", &confp->chan.rxgain) != 1) {
+ if (sscanf(v->value, "%30f", &confp->chan.rxgain) != 1) {
ast_log(LOG_WARNING, "Invalid rxgain: %s at line %d.\n", v->value, v->lineno);
}
} else if (!strcasecmp(v->name, "txgain")) {
- if (sscanf(v->value, "%f", &confp->chan.txgain) != 1) {
+ if (sscanf(v->value, "%30f", &confp->chan.txgain) != 1) {
ast_log(LOG_WARNING, "Invalid txgain: %s at line %d.\n", v->value, v->lineno);
}
} else if (!strcasecmp(v->name, "tonezone")) {
- if (sscanf(v->value, "%d", &confp->chan.tonezone) != 1) {
+ if (sscanf(v->value, "%30d", &confp->chan.tonezone) != 1) {
ast_log(LOG_WARNING, "Invalid tonezone: %s at line %d.\n", v->value, v->lineno);
}
} else if (!strcasecmp(v->name, "callerid")) {
@@ -14572,7 +14572,7 @@ static int process_dahdi(struct dahdi_chan_conf *confp, struct ast_variable *v,
ast_copy_string(original_args, v->value, sizeof(original_args));
/* 16 cadences allowed (8 pairs) */
- element_count = sscanf(v->value, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &c[0], &c[1], &c[2], &c[3], &c[4], &c[5], &c[6], &c[7], &c[8], &c[9], &c[10], &c[11], &c[12], &c[13], &c[14], &c[15]);
+ element_count = sscanf(v->value, "%30d,%30d,%30d,%30d,%30d,%30d,%30d,%30d,%30d,%30d,%30d,%30d,%30d,%30d,%30d,%30d", &c[0], &c[1], &c[2], &c[3], &c[4], &c[5], &c[6], &c[7], &c[8], &c[9], &c[10], &c[11], &c[12], &c[13], &c[14], &c[15]);
/* Cadence must be even (on/off) */
if (element_count % 2 == 1) {