Index: pbx/pbx_config.c =================================================================== --- pbx/pbx_config.c (revision 211550) +++ pbx/pbx_config.c (revision 211551) @@ -942,7 +942,7 @@ if (!strcmp(prior, "hint")) { iprior = PRIORITY_HINT; } else { - if (sscanf(prior, "%d", &iprior) != 1) { + if (sscanf(prior, "%30d", &iprior) != 1) { ast_cli(a->fd, "'%s' is not a valid priority\n", prior); prior = NULL; } @@ -1421,7 +1421,7 @@ ipri = lastpri; else ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n"); - } else if (sscanf(pri, "%d", &ipri) != 1 && + } else if (sscanf(pri, "%30d", &ipri) != 1 && (ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) { ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno); ipri = 0; @@ -1548,9 +1548,9 @@ c = dahdicopy; chan = strsep(&c, ","); while (chan) { - 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 { Index: pbx/pbx_loopback.c =================================================================== --- pbx/pbx_loopback.c (revision 211550) +++ pbx/pbx_loopback.c (revision 211551) @@ -120,7 +120,7 @@ if (!ast_strlen_zero(con)) *newcontext = con; if (!ast_strlen_zero(pri)) - sscanf(pri, "%d", priority); + sscanf(pri, "%30d", priority); } static int loopback_exists(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) Index: pbx/pbx_spool.c =================================================================== --- pbx/pbx_spool.c (revision 211550) +++ pbx/pbx_spool.c (revision 211551) @@ -182,7 +182,7 @@ } else if (!strcasecmp(buf, "data")) { ast_copy_string(o->data, c, sizeof(o->data)); } else if (!strcasecmp(buf, "maxretries")) { - if (sscanf(c, "%d", &o->maxretries) != 1) { + if (sscanf(c, "%30d", &o->maxretries) != 1) { ast_log(LOG_WARNING, "Invalid max retries at line %d of %s\n", lineno, fn); o->maxretries = 0; } @@ -193,24 +193,24 @@ } else if (!strcasecmp(buf, "extension")) { ast_copy_string(o->exten, c, sizeof(o->exten)); } else if (!strcasecmp(buf, "priority")) { - if ((sscanf(c, "%d", &o->priority) != 1) || (o->priority < 1)) { + if ((sscanf(c, "%30d", &o->priority) != 1) || (o->priority < 1)) { ast_log(LOG_WARNING, "Invalid priority at line %d of %s\n", lineno, fn); o->priority = 1; } } else if (!strcasecmp(buf, "retrytime")) { - if ((sscanf(c, "%d", &o->retrytime) != 1) || (o->retrytime < 1)) { + if ((sscanf(c, "%30d", &o->retrytime) != 1) || (o->retrytime < 1)) { ast_log(LOG_WARNING, "Invalid retrytime at line %d of %s\n", lineno, fn); o->retrytime = 300; } } else if (!strcasecmp(buf, "waittime")) { - if ((sscanf(c, "%d", &o->waittime) != 1) || (o->waittime < 1)) { + if ((sscanf(c, "%30d", &o->waittime) != 1) || (o->waittime < 1)) { ast_log(LOG_WARNING, "Invalid waittime at line %d of %s\n", lineno, fn); o->waittime = 45; } } else if (!strcasecmp(buf, "retry")) { o->retries++; } else if (!strcasecmp(buf, "startretry")) { - if (sscanf(c, "%ld", &o->callingpid) != 1) { + if (sscanf(c, "%30ld", &o->callingpid) != 1) { ast_log(LOG_WARNING, "Unable to retrieve calling PID!\n"); o->callingpid = 0; } Index: pbx/pbx_dundi.c =================================================================== --- pbx/pbx_dundi.c (revision 211550) +++ pbx/pbx_dundi.c (revision 211551) @@ -519,7 +519,7 @@ buf[0] = 0; if (map->weightstr) { pbx_substitute_variables_helper(NULL, map->weightstr, buf, sizeof(buf) - 1); - if (sscanf(buf, "%d", &map->_weight) != 1) + if (sscanf(buf, "%30d", &map->_weight) != 1) map->_weight = MAX_WEIGHT; } @@ -1132,7 +1132,7 @@ if (expiration > 0) { ast_debug(1, "Found cache expiring in %d seconds!\n", expiration); ptr += length + 1; - while((sscanf(ptr, "%d/%d/%d/%n", &(flags.flags), &weight, &tech, &length) == 3)) { + while((sscanf(ptr, "%30d/%30d/%30d/%n", &(flags.flags), &weight, &tech, &length) == 3)) { ptr += length; term = strchr(ptr, '|'); if (term) { @@ -4132,7 +4132,7 @@ 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 DUNDIRESULT!\n", args.resultnum); goto finish; @@ -4296,7 +4296,7 @@ } else if (x >= 4) { ast_copy_string(map->dcontext, name, sizeof(map->dcontext)); ast_copy_string(map->lcontext, fields[0], sizeof(map->lcontext)); - if ((sscanf(fields[1], "%d", &map->_weight) == 1) && (map->_weight >= 0) && (map->_weight <= MAX_WEIGHT)) { + if ((sscanf(fields[1], "%30d", &map->_weight) == 1) && (map->_weight >= 0) && (map->_weight <= MAX_WEIGHT)) { ast_copy_string(map->dest, fields[3], sizeof(map->dest)); if ((map->tech = str2tech(fields[2]))) map->dead = 0; @@ -4398,7 +4398,7 @@ if (c) { *c = '\0'; c++; - if (sscanf(c, "%d:%d", &port, &expire) == 2) { + if (sscanf(c, "%5d:%30d", &port, &expire) == 2) { /* Got it! */ inet_aton(data, &peer->addr.sin_addr); peer->addr.sin_family = AF_INET; @@ -4495,7 +4495,7 @@ peer->maxms = 0; } else if (!strcasecmp(v->value, "yes")) { peer->maxms = DEFAULT_MAXMS; - } else if (sscanf(v->value, "%d", &peer->maxms) != 1) { + } else if (sscanf(v->value, "%30d", &peer->maxms) != 1) { ast_log(LOG_WARNING, "Qualification of peer '%s' should be 'yes', 'no', or a number of milliseconds at line %d of dundi.conf\n", dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid), v->lineno); peer->maxms = 0; @@ -4732,14 +4732,14 @@ } else if (!strcasecmp(v->name, "authdebug")) { authdebug = ast_true(v->value); } else if (!strcasecmp(v->name, "ttl")) { - if ((sscanf(v->value, "%d", &x) == 1) && (x > 0) && (x < DUNDI_DEFAULT_TTL)) { + if ((sscanf(v->value, "%30d", &x) == 1) && (x > 0) && (x < DUNDI_DEFAULT_TTL)) { dundi_ttl = x; } else { ast_log(LOG_WARNING, "'%s' is not a valid TTL at line %d, must be number from 1 to %d\n", v->value, v->lineno, DUNDI_DEFAULT_TTL); } } else if (!strcasecmp(v->name, "autokill")) { - if (sscanf(v->value, "%d", &x) == 1) { + if (sscanf(v->value, "%30d", &x) == 1) { if (x >= 0) global_autokilltimeout = x; else @@ -4774,7 +4774,7 @@ } else if (!strcasecmp(v->name, "storehistory")) { global_storehistory = ast_true(v->value); } else if (!strcasecmp(v->name, "cachetime")) { - if ((sscanf(v->value, "%d", &x) == 1)) { + if ((sscanf(v->value, "%30d", &x) == 1)) { dundi_cache_time = x; } else { ast_log(LOG_WARNING, "'%s' is not a valid cache time at line %d. Using default value '%d'.\n", Index: pbx/dundi-parser.c =================================================================== --- pbx/dundi-parser.c (revision 211550) +++ pbx/dundi-parser.c (revision 211551) @@ -85,9 +85,9 @@ { unsigned int eid_int[6]; int x; - if (sscanf(s, "%x:%x:%x:%x:%x:%x", &eid_int[0], &eid_int[1], &eid_int[2], + if (sscanf(s, "%2x:%2x:%2x:%2x:%2x:%2x", &eid_int[0], &eid_int[1], &eid_int[2], &eid_int[3], &eid_int[4], &eid_int[5]) != 6) - return -1; + return -1; for (x=0;x<6;x++) eid->eid[x] = eid_int[x]; return 0; @@ -99,7 +99,7 @@ int x; if (sscanf(s, "%2x%2x%2x%2x%2x%2x", &eid_int[0], &eid_int[1], &eid_int[2], &eid_int[3], &eid_int[4], &eid_int[5]) != 6) - return -1; + return -1; for (x = 0; x < 6; x++) eid->eid[x] = eid_int[x]; return 0; Index: channels/misdn_config.c =================================================================== --- channels/misdn_config.c (revision 211550) +++ channels/misdn_config.c (revision 211551) @@ -892,9 +892,9 @@ int res; if (strchr(value,'x')) { - res = sscanf(value, "%x", &tmp); + res = sscanf(value, "%30x", &tmp); } else { - res = sscanf(value, "%d", &tmp); + res = sscanf(value, "%30d", &tmp); } if (res) { dest->num = ast_malloc(sizeof(int)); @@ -909,7 +909,7 @@ break; case MISDN_CTYPE_BOOLINT: dest->num = ast_malloc(sizeof(int)); - if (sscanf(value, "%d", &tmp)) { + if (sscanf(value, "%30d", &tmp)) { memcpy(dest->num, &tmp, sizeof(int)); } else { *(dest->num) = (ast_true(value) ? boolint_def : 0); @@ -978,7 +978,7 @@ for (token = strsep(&tmp, ","); token; token = strsep(&tmp, ","), *ptpbuf = 0) { if (!*token) continue; - if (sscanf(token, "%d-%d%s", &start, &end, ptpbuf) >= 2) { + if (sscanf(token, "%30d-%30d%511s", &start, &end, ptpbuf) >= 2) { for (; start <= end; start++) { if (start <= max_ports && start > 0) { cfg_for_ports[start] = 1; @@ -987,7 +987,7 @@ CLI_ERROR(v->name, v->value, cat); } } else { - if (sscanf(token, "%d%s", &start, ptpbuf)) { + if (sscanf(token, "%30d%511s", &start, ptpbuf)) { if (start <= max_ports && start > 0) { cfg_for_ports[start] = 1; ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0; Index: channels/chan_usbradio.c =================================================================== --- channels/chan_usbradio.c (revision 211550) +++ channels/chan_usbradio.c (revision 211551) @@ -259,8 +259,8 @@ #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif -static char *config = "usbradio.conf"; /* default config file */ -static char *config1 = "usbradio_tune.conf"; /* tune config file */ +static const char *config = "usbradio.conf"; /* default config file */ +static const char *config1 = "usbradio_tune.conf"; /* tune config file */ static FILE *frxcapraw = NULL, *frxcaptrace = NULL, *frxoutraw = NULL; static FILE *ftxcapraw = NULL, *ftxcaptrace = NULL, *ftxoutraw = NULL; @@ -1797,7 +1797,7 @@ static void store_rxgain(struct chan_usbradio_pvt *o, const char *s) { float f; - if (sscanf(s, "%f", &f) == 1) + if (sscanf(s, "%30f", &f) == 1) o->rxgain = f; ast_debug(4, "set rxgain = %f\n", f); } @@ -1805,7 +1805,7 @@ static void store_rxvoiceadj(struct chan_usbradio_pvt *o, const char *s) { float f; - if (sscanf(s, "%f", &f) == 1) + if (sscanf(s, "%30f", &f) == 1) o->rxvoiceadj = f; ast_debug(4, "set rxvoiceadj = %f\n", f); } @@ -1813,7 +1813,7 @@ static void store_rxctcssadj(struct chan_usbradio_pvt *o, const char *s) { float f; - if (sscanf(s, "%f", &f) == 1) + if (sscanf(s, "%30f", &f) == 1) o->rxctcssadj = f; ast_debug(4, "set rxctcssadj = %f\n", f); } Index: channels/chan_phone.c =================================================================== --- channels/chan_phone.c (revision 211550) +++ channels/chan_phone.c (revision 211551) @@ -1259,7 +1259,7 @@ float gain; /* try to scan number */ - if (sscanf(value, "%f", &gain) != 1) + if (sscanf(value, "%30f", &gain) != 1) { ast_log(LOG_ERROR, "Invalid %s value '%s' in '%s' config\n", value, gain_type, config); Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 211550) +++ channels/chan_dahdi.c (revision 211551) @@ -8485,7 +8485,7 @@ 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) @@ -9312,7 +9312,7 @@ 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; } @@ -9348,7 +9348,7 @@ 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; @@ -9370,8 +9370,8 @@ 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 { @@ -12593,7 +12593,7 @@ 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; @@ -13872,7 +13872,7 @@ #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; } @@ -13895,9 +13895,9 @@ #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")) { @@ -13986,7 +13986,7 @@ 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; } @@ -14023,7 +14023,7 @@ 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; @@ -14057,11 +14057,11 @@ } 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")) { @@ -14114,7 +14114,7 @@ } 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")) { @@ -14132,7 +14132,7 @@ } 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 { @@ -14208,19 +14208,19 @@ 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")) { @@ -14669,7 +14669,7 @@ 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) { Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 211550) +++ channels/chan_sip.c (revision 211551) @@ -2266,7 +2266,7 @@ req.len = strlen(req.data); } parse_copy(&reqcpy, &req); - if (sscanf(get_header(&reqcpy, "Content-Length"), "%d", &cl)) { + if (sscanf(get_header(&reqcpy, "Content-Length"), "%30d", &cl)) { while (cl > 0) { ast_mutex_lock(&tcptls_session->lock); if (!fread(buf, (cl < sizeof(buf)) ? cl : sizeof(buf), 1, tcptls_session->f)) { @@ -3022,7 +3022,7 @@ p->packets = pkt; /* Add it to the queue */ if (resp) { /* Parse out the response code */ - if (sscanf(pkt->data, "SIP/2.0 %d", &respid) == 1) { + if (sscanf(pkt->data, "SIP/2.0 %30d", &respid) == 1) { pkt->response_code = respid; } } @@ -3067,10 +3067,10 @@ /* If there are packets still waiting for delivery, delay the destruction */ if (p->packets) { if (!p->needdestroy) { - char method_str[30]; + char method_str[31]; ast_debug(3, "Re-scheduled destruction of SIP call %s\n", p->callid ? p->callid : ""); append_history(p, "ReliableXmit", "timeout"); - if (sscanf(p->lastmsg, "Tx: %s", method_str) == 1 || sscanf(p->lastmsg, "Rx: %s", method_str) == 1) { + if (sscanf(p->lastmsg, "Tx: %30s", method_str) == 1 || sscanf(p->lastmsg, "Rx: %30s", method_str) == 1) { if (method_match(SIP_CANCEL, method_str) || method_match(SIP_BYE, method_str)) { p->needdestroy = 1; } @@ -4364,7 +4364,7 @@ return -1; } memcpy(&dialog->sa.sin_addr, hp->h_addr, sizeof(dialog->sa.sin_addr)); - if (ast_strlen_zero(port) || sscanf(port, "%u", &portno) != 1) { + if (ast_strlen_zero(port) || sscanf(port, "%5u", &portno) != 1) { portno = (dialog->socket.type & SIP_TRANSPORT_TLS) ? STANDARD_TLS_PORT : STANDARD_SIP_PORT; } @@ -6613,7 +6613,7 @@ content_length = get_header(req, "Content-Length"); if (!ast_strlen_zero(content_length)) { - if (sscanf(content_length, "%ud", &x) != 1) { + if (sscanf(content_length, "%30u", &x) != 1) { ast_log(LOG_WARNING, "Invalid Content-Length: %s\n", content_length); return 0; } @@ -6717,10 +6717,10 @@ } /* We only want the m and c lines for audio */ for (m = get_sdp_iterate(&miterator, req, "m"); !ast_strlen_zero(m); m = get_sdp_iterate(&miterator, req, "m")) { - if ((media == SDP_AUDIO && ((sscanf(m, "audio %d/%d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || - (sscanf(m, "audio %d RTP/AVP %n", &x, &len) == 1 && len > 0))) || - (media == SDP_VIDEO && ((sscanf(m, "video %d/%d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || - (sscanf(m, "video %d RTP/AVP %n", &x, &len) == 1 && len > 0)))) { + if ((media == SDP_AUDIO && ((sscanf(m, "audio %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || + (sscanf(m, "audio %30d RTP/AVP %n", &x, &len) == 1 && len > 0))) || + (media == SDP_VIDEO && ((sscanf(m, "video %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || + (sscanf(m, "video %30d RTP/AVP %n", &x, &len) == 1 && len > 0)))) { /* See if there's a c= line for this media stream. * XXX There is no guarantee that we'll be grabbing the c= line for this * particular media stream here. However, this is the same logic used in process_sdp. @@ -6873,7 +6873,7 @@ ast_log(LOG_WARNING, "SDP sytax error in o= line\n"); return -1; } - if (!sscanf(token, "%" SCNd64, &rua_version)) { + if (!sscanf(token, "%30" SCNd64, &rua_version)) { ast_log(LOG_WARNING, "SDP sytax error in o= line version\n"); return -1; } @@ -6957,8 +6957,8 @@ numberofports = 1; len = -1; - if ((sscanf(m, "audio %d/%d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || - (sscanf(m, "audio %d RTP/AVP %n", &x, &len) == 1 && len > 0)) { + if ((sscanf(m, "audio %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || + (sscanf(m, "audio %30d RTP/AVP %n", &x, &len) == 1 && len > 0)) { audio = TRUE; p->offered_media[SDP_AUDIO].offered = TRUE; numberofmediastreams++; @@ -6968,7 +6968,7 @@ codecs = m + len; ast_copy_string(p->offered_media[SDP_AUDIO].text, codecs, sizeof(p->offered_media[SDP_AUDIO].text)); for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) { - if (sscanf(codecs, "%d%n", &codec, &len) != 1) { + if (sscanf(codecs, "%30d%n", &codec, &len) != 1) { ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs); return -1; } @@ -6976,8 +6976,8 @@ ast_verbose("Found RTP audio format %d\n", codec); ast_rtp_set_m_type(newaudiortp, codec); } - } else if ((sscanf(m, "video %d/%d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || - (sscanf(m, "video %d RTP/AVP %n", &x, &len) == 1 && len >= 0)) { + } else if ((sscanf(m, "video %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || + (sscanf(m, "video %30d RTP/AVP %n", &x, &len) == 1 && len >= 0)) { video = TRUE; p->novideo = FALSE; p->offered_media[SDP_VIDEO].offered = TRUE; @@ -6987,7 +6987,7 @@ codecs = m + len; ast_copy_string(p->offered_media[SDP_VIDEO].text, codecs, sizeof(p->offered_media[SDP_VIDEO].text)); for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) { - if (sscanf(codecs, "%d%n", &codec, &len) != 1) { + if (sscanf(codecs, "%30d%n", &codec, &len) != 1) { ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs); return -1; } @@ -6995,8 +6995,8 @@ ast_verbose("Found RTP video format %d\n", codec); ast_rtp_set_m_type(newvideortp, codec); } - } else if ((sscanf(m, "text %d/%d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || - (sscanf(m, "text %d RTP/AVP %n", &x, &len) == 1 && len > 0)) { + } else if ((sscanf(m, "text %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) || + (sscanf(m, "text %30d RTP/AVP %n", &x, &len) == 1 && len > 0)) { text = TRUE; p->offered_media[SDP_TEXT].offered = TRUE; p->notext = FALSE; @@ -7006,7 +7006,7 @@ codecs = m + len; ast_copy_string(p->offered_media[SDP_TEXT].text, codecs, sizeof(p->offered_media[SDP_TEXT].text)); for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) { - if (sscanf(codecs, "%d%n", &codec, &len) != 1) { + if (sscanf(codecs, "%30d%n", &codec, &len) != 1) { ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs); return -1; } @@ -7014,8 +7014,8 @@ ast_verbose("Found RTP text format %d\n", codec); ast_rtp_set_m_type(newtextrtp, codec); } - } else if (p->udptl && ( (sscanf(m, "image %d udptl t38%n", &x, &len) == 1 && len > 0) || - (sscanf(m, "image %d UDPTL t38%n", &x, &len) == 1 && len > 0) )) { + } else if (p->udptl && ( (sscanf(m, "image %30d udptl t38%n", &x, &len) == 1 && len > 0) || + (sscanf(m, "image %30d UDPTL t38%n", &x, &len) == 1 && len > 0) )) { if (debug) ast_verbose("Got T.38 offer in SDP in dialog %s\n", p->callid); p->offered_media[SDP_IMAGE].offered = TRUE; @@ -7203,7 +7203,7 @@ ast_rtp_codec_setpref(p->rtp, pref); } continue; - } else if (sscanf(a, "rtpmap: %u %127[^/]/", &codec, mimeSubtype) == 2) { + } else if (sscanf(a, "rtpmap: %30u %127[^/]/", &codec, mimeSubtype) == 2) { /* We have a rtpmap to handle */ if (last_rtpmap_codec < SDP_MAX_RTPMAP_CODECS) { @@ -7256,10 +7256,10 @@ /* Scan trough the a= lines for T38 attributes and set apropriate fileds */ iterator = req->sdp_start; while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') { - if ((sscanf(a, "T38FaxMaxBuffer:%d", &x) == 1)) { + if ((sscanf(a, "T38FaxMaxBuffer:%30d", &x) == 1)) { found = 1; ast_debug(3, "MaxBufferSize:%d\n", x); - } else if ((sscanf(a, "T38MaxBitRate:%d", &x) == 1) || (sscanf(a, "T38FaxMaxRate:%d", &x) == 1)) { + } else if ((sscanf(a, "T38MaxBitRate:%30d", &x) == 1) || (sscanf(a, "T38FaxMaxRate:%30d", &x) == 1)) { found = 1; ast_debug(3, "T38MaxBitRate: %d\n", x); switch (x) { @@ -7282,17 +7282,17 @@ p->t38.their_parms.rate = AST_T38_RATE_2400; break; } - } else if ((sscanf(a, "T38FaxVersion:%d", &x) == 1)) { + } else if ((sscanf(a, "T38FaxVersion:%30d", &x) == 1)) { found = 1; ast_debug(3, "FaxVersion: %d\n", x); p->t38.their_parms.version = x; - } else if ((sscanf(a, "T38FaxMaxDatagram:%d", &x) == 1) || (sscanf(a, "T38MaxDatagram:%d", &x) == 1)) { + } else if ((sscanf(a, "T38FaxMaxDatagram:%30d", &x) == 1) || (sscanf(a, "T38MaxDatagram:%30d", &x) == 1)) { found = 1; ast_debug(3, "FaxMaxDatagram: %d\n", x); ast_udptl_set_far_max_datagram(p->udptl, x); } else if ((strncmp(a, "T38FaxFillBitRemoval", 20) == 0)) { found = 1; - if (sscanf(a, "T38FaxFillBitRemoval:%d", &x) == 1) { + if (sscanf(a, "T38FaxFillBitRemoval:%30d", &x) == 1) { ast_debug(3, "FillBitRemoval: %d\n", x); if (x == 1) { p->t38.their_parms.fill_bit_removal = TRUE; @@ -7303,7 +7303,7 @@ } } else if ((strncmp(a, "T38FaxTranscodingMMR", 20) == 0)) { found = 1; - if (sscanf(a, "T38FaxTranscodingMMR:%d", &x) == 1) { + if (sscanf(a, "T38FaxTranscodingMMR:%30d", &x) == 1) { ast_debug(3, "Transcoding MMR: %d\n", x); if (x == 1) { p->t38.their_parms.transcoding_mmr = TRUE; @@ -7314,7 +7314,7 @@ } } else if ((strncmp(a, "T38FaxTranscodingJBIG", 21) == 0)) { found = 1; - if (sscanf(a, "T38FaxTranscodingJBIG:%d", &x) == 1) { + if (sscanf(a, "T38FaxTranscodingJBIG:%30d", &x) == 1) { ast_debug(3, "Transcoding JBIG: %d\n", x); if (x == 1) { p->t38.their_parms.transcoding_jbig = TRUE; @@ -8064,7 +8064,7 @@ struct sip_request resp; int seqno = 0; - if (reliable && (sscanf(get_header(req, "CSeq"), "%d ", &seqno) != 1)) { + if (reliable && (sscanf(get_header(req, "CSeq"), "%30d ", &seqno) != 1)) { ast_log(LOG_WARNING, "Unable to determine sequence number from '%s'\n", get_header(req, "CSeq")); return -1; } @@ -8232,7 +8232,7 @@ char tmp[512]; int seqno = 0; - if (reliable && (sscanf(get_header(req, "CSeq"), "%d ", &seqno) != 1)) { + if (reliable && (sscanf(get_header(req, "CSeq"), "%30d ", &seqno) != 1)) { ast_log(LOG_WARNING, "Unable to determine sequence number from '%s'\n", get_header(req, "CSeq")); return -1; } @@ -8849,7 +8849,7 @@ struct sip_request resp; int seqno; - if (sscanf(get_header(req, "CSeq"), "%d ", &seqno) != 1) { + if (sscanf(get_header(req, "CSeq"), "%30d ", &seqno) != 1) { ast_log(LOG_WARNING, "Unable to get seqno from '%s'\n", get_header(req, "CSeq")); return -1; } @@ -8887,7 +8887,7 @@ { struct sip_request resp; int seqno; - if (sscanf(get_header(req, "CSeq"), "%d ", &seqno) != 1) { + if (sscanf(get_header(req, "CSeq"), "%30d ", &seqno) != 1) { ast_log(LOG_WARNING, "Unable to get seqno from '%s'\n", get_header(req, "CSeq")); return -1; } @@ -10402,7 +10402,7 @@ char *s = strcasestr(contact, ";expires="); if (s) { expires = strsep(&s, ";"); /* trim ; and beyond */ - if (sscanf(expires + 9, "%d", &expiry) != 1) + if (sscanf(expires + 9, "%30d", &expiry) != 1) expiry = default_expiry; } else { /* Nothing has been specified */ @@ -15019,7 +15019,7 @@ if (!args.number) { number = 1; } else { - sscanf(args.number, "%d", &number); + sscanf(args.number, "%30d", &number); if (number < 1) number = 1; } @@ -15880,7 +15880,7 @@ } tmptmp = strcasestr(contact, "expires="); if (tmptmp) { - if (sscanf(tmptmp + 8, "%d;", &expires) != 1) + if (sscanf(tmptmp + 8, "%30d;", &expires) != 1) expires = 0; } @@ -19064,7 +19064,7 @@ ast_log(LOG_ERROR, "Missing Cseq. Dropping this SIP message, it's incomplete.\n"); error = 1; } - if (!error && sscanf(cseq, "%d%n", &seqno, &len) != 1) { + if (!error && sscanf(cseq, "%30d%n", &seqno, &len) != 1) { ast_log(LOG_ERROR, "No seqno in '%s'. Dropping incomplete message.\n", cmd); error = 1; } @@ -19094,7 +19094,7 @@ if (ast_strlen_zero(e)) { return 0; } - if (sscanf(e, "%d %n", &respid, &len) != 1) { + if (sscanf(e, "%30d %n", &respid, &len) != 1) { ast_log(LOG_WARNING, "Invalid response: '%s'\n", e); return 0; } @@ -19624,7 +19624,7 @@ if ((port = strrchr(line, ':'))) { *port++ = '\0'; - if (!sscanf(port, "%u", portnum)) { + if (!sscanf(port, "%5u", portnum)) { ast_log(LOG_NOTICE, "'%s' is not a valid port number on line %d of sip.conf. using default.\n", port, lineno); port = NULL; } @@ -20041,7 +20041,7 @@ *p_interval = 0; p_hdrval = ast_skip_blanks(p_hdrval); - if (!sscanf(p_hdrval, "%d", p_interval)) { + if (!sscanf(p_hdrval, "%30d", p_interval)) { ast_log(LOG_WARNING, "Parsing of Min-SE header failed %s\n", p_hdrval); return -1; } @@ -20071,7 +20071,7 @@ while ((p_token = strsep(&p_se_hdr, ";"))) { p_token = ast_skip_blanks(p_token); - if (!sscanf(p_token, "%d", p_interval)) { + if (!sscanf(p_token, "%30d", p_interval)) { ast_log(LOG_WARNING, "Parsing of Session-Expires failed\n"); return -1; } @@ -21053,19 +21053,19 @@ user->stimer.st_mode_oper = i; } } else if (!strcasecmp(v->name, "session-expires")) { - if (sscanf(v->value, "%d", &user->stimer.st_max_se) != 1) { + if (sscanf(v->value, "%30d", &user->stimer.st_max_se) != 1) { ast_log(LOG_WARNING, "Invalid session-expires '%s' at line %d of %s\n", v->value, v->lineno, config); user->stimer.st_max_se = global_max_se; - } + } } else if (!strcasecmp(v->name, "session-minse")) { - if (sscanf(v->value, "%d", &user->stimer.st_min_se) != 1) { + if (sscanf(v->value, "%30d", &user->stimer.st_min_se) != 1) { ast_log(LOG_WARNING, "Invalid session-minse '%s' at line %d of %s\n", v->value, v->lineno, config); user->stimer.st_min_se = global_min_se; - } + } if (user->stimer.st_min_se < 90) { ast_log(LOG_WARNING, "session-minse '%s' at line %d of %s is not allowed to be < 90 secs\n", v->value, v->lineno, config); user->stimer.st_min_se = global_min_se; - } + } } else if (!strcasecmp(v->name, "session-refresher")) { int i = (int) str2strefresher(v->value); if (i < 0) { @@ -21278,7 +21278,7 @@ } else if (realtime && !strcasecmp(v->name, "regseconds")) { ast_get_time_t(v->value, ®seconds, 0, NULL); } else if (realtime && !strcasecmp(v->name, "lastms")) { - sscanf(v->value, "%d", &peer->lastms); + sscanf(v->value, "%30d", &peer->lastms); } else if (realtime && !strcasecmp(v->name, "ipaddr") && !ast_strlen_zero(v->value) ) { inet_aton(v->value, &(peer->addr.sin_addr)); } else if (realtime && !strcasecmp(v->name, "name")) @@ -21458,22 +21458,22 @@ } else if (!strcasecmp(v->name, "autoframing")) { peer->autoframing = ast_true(v->value); } else if (!strcasecmp(v->name, "rtptimeout")) { - if ((sscanf(v->value, "%d", &peer->rtptimeout) != 1) || (peer->rtptimeout < 0)) { + if ((sscanf(v->value, "%30d", &peer->rtptimeout) != 1) || (peer->rtptimeout < 0)) { ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno); peer->rtptimeout = global_rtptimeout; } } else if (!strcasecmp(v->name, "rtpholdtimeout")) { - if ((sscanf(v->value, "%d", &peer->rtpholdtimeout) != 1) || (peer->rtpholdtimeout < 0)) { + if ((sscanf(v->value, "%30d", &peer->rtpholdtimeout) != 1) || (peer->rtpholdtimeout < 0)) { ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno); peer->rtpholdtimeout = global_rtpholdtimeout; } } else if (!strcasecmp(v->name, "rtpkeepalive")) { - if ((sscanf(v->value, "%d", &peer->rtpkeepalive) != 1) || (peer->rtpkeepalive < 0)) { + if ((sscanf(v->value, "%30d", &peer->rtpkeepalive) != 1) || (peer->rtpkeepalive < 0)) { ast_log(LOG_WARNING, "'%s' is not a valid RTP keepalive time at line %d. Using default.\n", v->value, v->lineno); peer->rtpkeepalive = global_rtpkeepalive; } } else if (!strcasecmp(v->name, "timert1")) { - if ((sscanf(v->value, "%d", &peer->timer_t1) != 1) || (peer->timer_t1 < 0)) { + if ((sscanf(v->value, "%30d", &peer->timer_t1) != 1) || (peer->timer_t1 < 0)) { ast_log(LOG_WARNING, "'%s' is not a valid T1 time at line %d. Using default.\n", v->value, v->lineno); peer->timer_t1 = global_t1; } @@ -21483,7 +21483,7 @@ peer->timer_b = peer->timer_t1 * 64; } } else if (!strcasecmp(v->name, "timerb")) { - if ((sscanf(v->value, "%d", &peer->timer_b) != 1) || (peer->timer_b < 0)) { + if ((sscanf(v->value, "%30d", &peer->timer_b) != 1) || (peer->timer_b < 0)) { ast_log(LOG_WARNING, "'%s' is not a valid Timer B time at line %d. Using default.\n", v->value, v->lineno); peer->timer_b = global_timer_b; } @@ -21500,7 +21500,7 @@ peer->maxms = 0; } else if (!strcasecmp(v->value, "yes")) { peer->maxms = default_qualify ? default_qualify : DEFAULT_MAXMS; - } else if (sscanf(v->value, "%d", &peer->maxms) != 1) { + } else if (sscanf(v->value, "%30d", &peer->maxms) != 1) { ast_log(LOG_WARNING, "Qualification of peer '%s' should be 'yes', 'no', or a number of milliseconds at line %d of sip.conf\n", peer->name, v->lineno); peer->maxms = 0; } @@ -21514,7 +21514,7 @@ } } else if (!strcasecmp(v->name, "qualifyfreq")) { int i; - if (sscanf(v->value, "%d", &i) == 1) + if (sscanf(v->value, "%30d", &i) == 1) peer->qualifyfreq = i * 1000; else { ast_log(LOG_WARNING, "Invalid qualifyfreq number '%s' at line %d of %s\n", v->value, v->lineno, config); @@ -21533,12 +21533,12 @@ peer->stimer.st_mode_oper = i; } } else if (!strcasecmp(v->name, "session-expires")) { - if (sscanf(v->value, "%d", &peer->stimer.st_max_se) != 1) { + if (sscanf(v->value, "%30d", &peer->stimer.st_max_se) != 1) { ast_log(LOG_WARNING, "Invalid session-expires '%s' at line %d of %s\n", v->value, v->lineno, config); peer->stimer.st_max_se = global_max_se; } } else if (!strcasecmp(v->name, "session-minse")) { - if (sscanf(v->value, "%d", &peer->stimer.st_min_se) != 1) { + if (sscanf(v->value, "%30d", &peer->stimer.st_min_se) != 1) { ast_log(LOG_WARNING, "Invalid session-minse '%s' at line %d of %s\n", v->value, v->lineno, config); peer->stimer.st_min_se = global_min_se; } @@ -21963,17 +21963,17 @@ } else if (!strcasecmp(v->name, "vmexten")) { ast_copy_string(default_vmexten, v->value, sizeof(default_vmexten)); } else if (!strcasecmp(v->name, "rtptimeout")) { - if ((sscanf(v->value, "%d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) { + if ((sscanf(v->value, "%30d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) { ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno); global_rtptimeout = 0; } } else if (!strcasecmp(v->name, "rtpholdtimeout")) { - if ((sscanf(v->value, "%d", &global_rtpholdtimeout) != 1) || (global_rtpholdtimeout < 0)) { + if ((sscanf(v->value, "%30d", &global_rtpholdtimeout) != 1) || (global_rtpholdtimeout < 0)) { ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno); global_rtpholdtimeout = 0; } } else if (!strcasecmp(v->name, "rtpkeepalive")) { - if ((sscanf(v->value, "%d", &global_rtpkeepalive) != 1) || (global_rtpkeepalive < 0)) { + if ((sscanf(v->value, "%30d", &global_rtpkeepalive) != 1) || (global_rtpkeepalive < 0)) { ast_log(LOG_WARNING, "'%s' is not a valid RTP keepalive time at line %d. Using default.\n", v->value, v->lineno); global_rtpkeepalive = 0; } @@ -22111,7 +22111,7 @@ if (!externip.sin_port) externip.sin_port = bindaddr.sin_port; } else if (!strcasecmp(v->name, "externrefresh")) { - if (sscanf(v->value, "%d", &externrefresh) != 1) { + if (sscanf(v->value, "%30d", &externrefresh) != 1) { ast_log(LOG_WARNING, "Invalid externrefresh value '%s', must be an integer >0 at line %d\n", v->value, v->lineno); externrefresh = 10; } @@ -22171,7 +22171,7 @@ ast_log(LOG_WARNING, "Invalid cos_text value at line %d, refer to QoS documentation\n", v->lineno); } else if (!strcasecmp(v->name, "bindport")) { int i; - if (sscanf(v->value, "%d", &i) == 1) { + if (sscanf(v->value, "%5d", &i) == 1) { bindaddr.sin_port = htons(i); } else { ast_log(LOG_WARNING, "Invalid port number '%s' at line %d of %s\n", v->value, v->lineno, config); @@ -22181,13 +22181,13 @@ default_qualify = 0; } else if (!strcasecmp(v->value, "yes")) { default_qualify = DEFAULT_MAXMS; - } else if (sscanf(v->value, "%d", &default_qualify) != 1) { + } else if (sscanf(v->value, "%30d", &default_qualify) != 1) { ast_log(LOG_WARNING, "Qualification default should be 'yes', 'no', or a number of milliseconds at line %d of sip.conf\n", v->lineno); default_qualify = 0; } } else if (!strcasecmp(v->name, "qualifyfreq")) { int i; - if (sscanf(v->value, "%d", &i) == 1) + if (sscanf(v->value, "%30d", &i) == 1) global_qualifyfreq = i * 1000; else { ast_log(LOG_WARNING, "Invalid qualifyfreq number '%s' at line %d of %s\n", v->value, v->lineno, config); @@ -22210,12 +22210,12 @@ global_st_mode = i; } } else if (!strcasecmp(v->name, "session-expires")) { - if (sscanf(v->value, "%d", &global_max_se) != 1) { + if (sscanf(v->value, "%30d", &global_max_se) != 1) { ast_log(LOG_WARNING, "Invalid session-expires '%s' at line %d of %s\n", v->value, v->lineno, config); global_max_se = DEFAULT_MAX_SE; } } else if (!strcasecmp(v->name, "session-minse")) { - if (sscanf(v->value, "%d", &global_min_se) != 1) { + if (sscanf(v->value, "%30d", &global_min_se) != 1) { ast_log(LOG_WARNING, "Invalid session-minse '%s' at line %d of %s\n", v->value, v->lineno, config); global_min_se = DEFAULT_MIN_SE; } @@ -22803,7 +22803,7 @@ memset(lport, 0, sizeof(lport)); localtmp++; /* This is okey because lhost and lport are as big as tmp */ - sscanf(localtmp, "%[^<>:; ]:%[^<>:; ]", lhost, lport); + sscanf(localtmp, "%80[^<>:; ]:%80[^<>:; ]", lhost, lport); if (ast_strlen_zero(lhost)) { ast_log(LOG_ERROR, "Can't find the host address\n"); return 0; Index: channels/chan_agent.c =================================================================== --- channels/chan_agent.c (revision 211550) +++ channels/chan_agent.c (revision 211551) @@ -1333,9 +1333,9 @@ struct timeval tv; s = data; - if ((s[0] == '@') && (sscanf(s + 1, "%d", &groupoff) == 1)) { + if ((s[0] == '@') && (sscanf(s + 1, "%30d", &groupoff) == 1)) { groupmatch = (1 << groupoff); - } else if ((s[0] == ':') && (sscanf(s + 1, "%d", &groupoff) == 1)) { + } else if ((s[0] == ':') && (sscanf(s + 1, "%30d", &groupoff) == 1)) { groupmatch = (1 << groupoff); waitforagent = 1; } else @@ -2298,9 +2298,9 @@ int res = AST_DEVICE_INVALID; s = data; - if ((s[0] == '@') && (sscanf(s + 1, "%d", &groupoff) == 1)) + if ((s[0] == '@') && (sscanf(s + 1, "%30d", &groupoff) == 1)) groupmatch = (1 << groupoff); - else if ((s[0] == ':') && (sscanf(s + 1, "%d", &groupoff) == 1)) { + else if ((s[0] == ':') && (sscanf(s + 1, "%30d", &groupoff) == 1)) { groupmatch = (1 << groupoff); } else groupmatch = 0; Index: channels/iax2-provision.c =================================================================== --- channels/iax2-provision.c (revision 211550) +++ channels/iax2-provision.c (revision 211551) @@ -261,7 +261,7 @@ ast_mutex_lock(&provlock); ast_db_get("iax/provisioning/cache", template, tmp, sizeof(tmp)); - if (sscanf(tmp, "v%x", version) != 1) { + if (sscanf(tmp, "v%30x", version) != 1) { if (strcmp(tmp, "u")) { ret = iax_provision_build(&ied, version, template, force); if (ret) @@ -319,7 +319,7 @@ v = ast_variable_browse(cfg, s); while(v) { if (!strcasecmp(v->name, "port") || !strcasecmp(v->name, "serverport")) { - if ((sscanf(v->value, "%d", &x) == 1) && (x > 0) && (x < 65535)) { + if ((sscanf(v->value, "%5d", &x) == 1) && (x > 0) && (x < 65535)) { if (!strcasecmp(v->name, "port")) { cur->port = x; foundportno = 1; Index: channels/chan_iax2.c =================================================================== --- channels/chan_iax2.c (revision 211550) +++ channels/chan_iax2.c (revision 211551) @@ -10782,18 +10782,18 @@ peer->maxms = 0; } else if (!strcasecmp(v->value, "yes")) { peer->maxms = DEFAULT_MAXMS; - } else if (sscanf(v->value, "%d", &peer->maxms) != 1) { + } else if (sscanf(v->value, "%30d", &peer->maxms) != 1) { ast_log(LOG_WARNING, "Qualification of peer '%s' should be 'yes', 'no', or a number of milliseconds at line %d of iax.conf\n", peer->name, v->lineno); peer->maxms = 0; } } else if (!strcasecmp(v->name, "qualifysmoothing")) { peer->smoothing = ast_true(v->value); } else if (!strcasecmp(v->name, "qualifyfreqok")) { - if (sscanf(v->value, "%d", &peer->pokefreqok) != 1) { + if (sscanf(v->value, "%30d", &peer->pokefreqok) != 1) { ast_log(LOG_WARNING, "Qualification testing frequency of peer '%s' when OK should a number of milliseconds at line %d of iax.conf\n", peer->name, v->lineno); } } else if (!strcasecmp(v->name, "qualifyfreqnotok")) { - if (sscanf(v->value, "%d", &peer->pokefreqnotok) != 1) { + if (sscanf(v->value, "%30d", &peer->pokefreqnotok) != 1) { ast_log(LOG_WARNING, "Qualification testing frequency of peer '%s' when NOT OK should be a number of milliseconds at line %d of iax.conf\n", peer->name, v->lineno); } else ast_log(LOG_WARNING, "Set peer->pokefreqnotok to %d\n", peer->pokefreqnotok); } else if (!strcasecmp(v->name, "timezone")) { @@ -11378,7 +11378,7 @@ if (trunkmaxsize == 0) trunkmaxsize = MAX_TRUNKDATA; } else if (!strcasecmp(v->name, "autokill")) { - if (sscanf(v->value, "%d", &x) == 1) { + if (sscanf(v->value, "%30d", &x) == 1) { if (x >= 0) autokill = x; else Index: channels/chan_oss.c =================================================================== --- channels/chan_oss.c (revision 211550) +++ channels/chan_oss.c (revision 211551) @@ -1231,7 +1231,7 @@ static void store_boost(struct chan_oss_pvt *o, const char *s) { double boost = 0; - if (sscanf(s, "%lf", &boost) != 1) { + if (sscanf(s, "%30lf", &boost) != 1) { ast_log(LOG_WARNING, "invalid boost <%s>\n", s); return; } Index: channels/chan_misdn.c =================================================================== --- channels/chan_misdn.c (revision 211550) +++ channels/chan_misdn.c (revision 211551) @@ -1220,7 +1220,7 @@ ok = 1; } return ok ? CLI_SUCCESS : CLI_SHOWUSAGE; - } else if (!sscanf(a->argv[3], "%d", &onlyport) || onlyport < 0) { + } else if (!sscanf(a->argv[3], "%5d", &onlyport) || onlyport < 0) { ast_cli(a->fd, "Unknown option: %s\n", a->argv[3]); return CLI_SHOWUSAGE; } Index: channels/chan_skinny.c =================================================================== --- channels/chan_skinny.c (revision 211550) +++ channels/chan_skinny.c (revision 211551) @@ -5950,7 +5950,7 @@ } else if (!strcasecmp(v->name, "disallow")) { ast_parse_allow_disallow(&default_prefs, &default_capability, v->value, 0); } else if (!strcasecmp(v->name, "bindport")) { - if (sscanf(v->value, "%d", &ourport) == 1) { + if (sscanf(v->value, "%5d", &ourport) == 1) { bindaddr.sin_port = htons(ourport); } else { ast_log(LOG_WARNING, "Invalid bindport '%s' at line %d of %s\n", v->value, v->lineno, config); Index: channels/chan_mgcp.c =================================================================== --- channels/chan_mgcp.c (revision 211550) +++ channels/chan_mgcp.c (revision 211551) @@ -1890,7 +1890,7 @@ ast_log(LOG_WARNING, "Unable to lookup host in c= line, '%s'\n", c); return -1; } - if (sscanf(m, "audio %d RTP/AVP %n", &portno, &len) != 1) { + if (sscanf(m, "audio %30d RTP/AVP %n", &portno, &len) != 1) { ast_log(LOG_WARNING, "Unable to determine port number for RTP in '%s'\n", m); return -1; } @@ -1905,7 +1905,7 @@ ast_rtp_pt_clear(sub->rtp); codecs = ast_strdupa(m + len); while (!ast_strlen_zero(codecs)) { - if (sscanf(codecs, "%d%n", &codec, &len) != 1) { + if (sscanf(codecs, "%30d%n", &codec, &len) != 1) { if (codec_count) break; ast_log(LOG_WARNING, "Error in codec string '%s' at '%s'\n", m, codecs); @@ -1921,7 +1921,7 @@ sdpLineNum_iterator_init(&iterator); while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') { char* mimeSubtype = ast_strdupa(a); /* ensures we have enough space */ - if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) != 2) + if (sscanf(a, "rtpmap: %30u %127[^/]/", &codec, mimeSubtype) != 2) continue; /* Note: should really look at the 'freq' and '#chans' params too */ ast_rtp_set_rtpmap_type(sub->rtp, codec, "audio", mimeSubtype, 0); @@ -2054,7 +2054,7 @@ mgr = ast_calloc(1, sizeof(*mgr) + resp.len + 1); if (mgr) { /* Store MGCP response in case we have to retransmit */ - sscanf(req->identifier, "%d", &mgr->seqno); + sscanf(req->identifier, "%30d", &mgr->seqno); time(&mgr->whensent); mgr->len = resp.len; memcpy(mgr->buf, resp.data, resp.len); @@ -3287,7 +3287,7 @@ time_t now; struct mgcp_response *prev = NULL, *cur, *next, *answer=NULL; time(&now); - if (sscanf(req->identifier, "%d", &seqno) != 1) + if (sscanf(req->identifier, "%30d", &seqno) != 1) seqno = 0; cur = sub->parent->parent->responses; while(cur) { @@ -3345,7 +3345,7 @@ return 1; } - if (sscanf(req.verb, "%d", &result) && sscanf(req.identifier, "%d", &ident)) { + if (sscanf(req.verb, "%30d", &result) && sscanf(req.identifier, "%30d", &ident)) { /* Try to find who this message is for, if it's important */ sub = find_subchannel_and_lock(NULL, ident, &sin); if (sub) { @@ -4162,7 +4162,7 @@ if (ast_str2cos(v->value, &cos_audio)) ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno); } else if (!strcasecmp(v->name, "port")) { - if (sscanf(v->value, "%d", &ourport) == 1) { + if (sscanf(v->value, "%5d", &ourport) == 1) { bindaddr.sin_port = htons(ourport); } else { ast_log(LOG_WARNING, "Invalid port number '%s' at line %d of %s\n", v->value, v->lineno, config); Index: agi/eagi-test.c =================================================================== --- agi/eagi-test.c (revision 211550) +++ agi/eagi-test.c (revision 211551) @@ -156,7 +156,7 @@ } tmp = getenv("agi_enhanced"); if (tmp) { - if (sscanf(tmp, "%d.%d", &ver, &subver) != 2) + if (sscanf(tmp, "%30d.%30d", &ver, &subver) != 2) ver = 0; } if (ver < 1) { Index: agi/eagi-sphinx-test.c =================================================================== --- agi/eagi-sphinx-test.c (revision 211550) +++ agi/eagi-sphinx-test.c (revision 211551) @@ -223,7 +223,7 @@ connect_sphinx(); tmp = getenv("agi_enhanced"); if (tmp) { - if (sscanf(tmp, "%d.%d", &ver, &subver) != 2) + if (sscanf(tmp, "%30d.%30d", &ver, &subver) != 2) ver = 0; } if (ver < 1) { Index: apps/app_stack.c =================================================================== --- apps/app_stack.c (revision 211550) +++ apps/app_stack.c (revision 211551) @@ -417,7 +417,7 @@ ast_debug(1, "Gosub called with %d arguments: 0:%s 1:%s 2:%s 3:%s 4:%s\n", argc, argv[0], argv[1], argv[2], argv[3], argc == 5 ? argv[4] : ""); - if (sscanf(argv[3], "%d", &priority) != 1 || priority < 1) { + if (sscanf(argv[3], "%30d", &priority) != 1 || priority < 1) { /* Lookup the priority label */ if ((priority = ast_findlabel_extension(chan, argv[1], argv[2], argv[3], chan->cid.cid_num)) < 0) { ast_log(LOG_ERROR, "Priority '%s' not found in '%s@%s'\n", argv[3], argv[2], argv[1]); Index: apps/app_chanspy.c =================================================================== --- apps/app_chanspy.c (revision 211550) +++ apps/app_chanspy.c (revision 211551) @@ -813,7 +813,7 @@ if (ast_test_flag(&flags, OPTION_VOLUME) && opts[OPT_ARG_VOLUME]) { int vol; - if ((sscanf(opts[OPT_ARG_VOLUME], "%d", &vol) != 1) || (vol > 4) || (vol < -4)) + if ((sscanf(opts[OPT_ARG_VOLUME], "%30d", &vol) != 1) || (vol > 4) || (vol < -4)) ast_log(LOG_NOTICE, "Volume factor must be a number between -4 and 4\n"); else volfactor = vol; @@ -896,7 +896,7 @@ if (ast_test_flag(&flags, OPTION_VOLUME) && opts[OPT_ARG_VOLUME]) { int vol; - if ((sscanf(opts[OPT_ARG_VOLUME], "%d", &vol) != 1) || (vol > 4) || (vol < -4)) + if ((sscanf(opts[OPT_ARG_VOLUME], "%30d", &vol) != 1) || (vol > 4) || (vol < -4)) ast_log(LOG_NOTICE, "Volume factor must be a number between -4 and 4\n"); else volfactor = vol; Index: apps/app_adsiprog.c =================================================================== --- apps/app_adsiprog.c (revision 211550) +++ apps/app_adsiprog.c (revision 211551) @@ -187,7 +187,7 @@ if (!(argtype & ARG_NUMBER)) return -1; /* Octal value */ - if (sscanf(src, "%o", (int *)out) != 1) + if (sscanf(src, "%30o", (int *)out) != 1) return -1; if (argtype & ARG_STRING) { /* Convert */ @@ -197,7 +197,7 @@ if (!(argtype & ARG_NUMBER)) return -1; /* Hex value */ - if (sscanf(src + 2, "%x", (unsigned int *)out) != 1) + if (sscanf(src + 2, "%30x", (unsigned int *)out) != 1) return -1; if (argtype & ARG_STRING) { /* Convert */ @@ -207,7 +207,7 @@ if (!(argtype & ARG_NUMBER)) return -1; /* Hex value */ - if (sscanf(src, "%d", (int *)out) != 1) + if (sscanf(src, "%30d", (int *)out) != 1) return -1; if (argtype & ARG_STRING) { /* Convert */ Index: apps/app_alarmreceiver.c =================================================================== --- apps/app_alarmreceiver.c (revision 211550) +++ apps/app_alarmreceiver.c (revision 211551) @@ -115,7 +115,7 @@ return; } - sscanf(value, "%u", &v); + sscanf(value, "%30u", &v); v++; ast_verb(4, "AlarmReceiver: New value for %s: %u\n", key, v); Index: apps/app_talkdetect.c =================================================================== --- apps/app_talkdetect.c (revision 211550) +++ apps/app_talkdetect.c (revision 211551) @@ -83,11 +83,11 @@ tmp = ast_strdupa(data); AST_STANDARD_APP_ARGS(args, tmp); - if (!ast_strlen_zero(args.silence) && (sscanf(args.silence, "%d", &x) == 1) && (x > 0)) + if (!ast_strlen_zero(args.silence) && (sscanf(args.silence, "%30d", &x) == 1) && (x > 0)) sil = x; - if (!ast_strlen_zero(args.min) && (sscanf(args.min, "%d", &x) == 1) && (x > 0)) + if (!ast_strlen_zero(args.min) && (sscanf(args.min, "%30d", &x) == 1) && (x > 0)) min = x; - if (!ast_strlen_zero(args.max) && (sscanf(args.max, "%d", &x) == 1) && (x > 0)) + if (!ast_strlen_zero(args.max) && (sscanf(args.max, "%30d", &x) == 1) && (x > 0)) max = x; ast_debug(1, "Preparing detect of '%s', sil=%d, min=%d, max=%d\n", args.filename, sil, min, max); Index: apps/app_setcallerid.c =================================================================== --- apps/app_setcallerid.c (revision 211550) +++ apps/app_setcallerid.c (revision 211551) @@ -70,7 +70,7 @@ } /* For interface consistency, permit the argument to be specified as a number */ - if (sscanf(data, "%d", &pres) != 1 || pres < 0 || pres > 255 || (pres & 0x9c)) { + if (sscanf(data, "%30d", &pres) != 1 || pres < 0 || pres > 255 || (pres & 0x9c)) { pres = ast_parse_caller_presentation(data); } Index: apps/app_rpt.c =================================================================== --- apps/app_rpt.c (revision 211550) +++ apps/app_rpt.c (revision 211551) @@ -810,7 +810,7 @@ if (str == NULL) return -1; /* leave this %i alone, non-base-10 input is useful here */ - if (sscanf(str, "%i", &ret) != 1) + if (sscanf(str, "%30i", &ret) != 1) return -1; return ret; } @@ -979,7 +979,7 @@ /* do not use atoi() here, we need to be able to have the input specified in hex or decimal so we use sscanf with a %i */ - if (sscanf(var->value, "%i", &rpt_vars[n].p.iobase) != 1) + if (sscanf(var->value, "%30i", &rpt_vars[n].p.iobase) != 1) rpt_vars[n].p.iobase = DEFAULT_IOBASE; } else if (!strcmp(var->name, "functions")) { rpt_vars[n].p.simple = 0; @@ -1671,7 +1671,7 @@ tonesubset = strsep(&stringp, ")"); if (!tonesubset) break; - if (sscanf(tonesubset, "(%d,%d,%d,%d", &f1, &f2, &duration, &litude) != 4) + if (sscanf(tonesubset, "(%30d,%30d,%30d,%30d", &f1, &f2, &duration, &litude) != 4) break; res = play_tone_pair(chan, f1, f2, duration, amplitude); if (res) @@ -3482,6 +3482,8 @@ static void handle_link_data(struct rpt *myrpt, struct rpt_link *mylink, char *str) { + /* XXX ATTENTION: if you change the size of these arrays you MUST + * change the limits in corresponding sscanf() calls below. */ char cmd[300] = "", dest[300], src[300], c; int seq, res; struct rpt_link *l; @@ -3499,7 +3501,7 @@ ast_softhangup(mylink->chan, AST_SOFTHANGUP_DEV); return; } - if (sscanf(str, "%s %s %s %d %c", cmd, dest, src, &seq, &c) != 5) { + if (sscanf(str, "%299s %299s %299s %30d %1c", cmd, dest, src, &seq, &c) != 5) { ast_log(LOG_WARNING, "Unable to parse link string %s\n", str); return; } @@ -4103,7 +4105,7 @@ { double input2 = 0.0; long long modifier = (long long)pow(10.0, (double)places); - if (sscanf(input, "%lf", &input2) == 1) { + if (sscanf(input, "%30lf", &input2) == 1) { long long input3 = input2 * modifier; *ints = input3 / modifier; *decs = input3 % modifier; @@ -5370,12 +5372,16 @@ static int handle_remote_data(struct rpt *myrpt, char *str) { + /* XXX ATTENTION: if you change the size of these arrays you MUST + * change the limits in corresponding sscanf() calls below. */ char cmd[300], dest[300], src[300], c; int seq, res; if (!strcmp(str, discstr)) return 0; - if (sscanf(str, "%s %s %s %d %c", cmd, dest, src, &seq, &c) != 5) { + /* XXX WARNING: be very careful with the limits on the folowing + * sscanf() call, make sure they match the values defined above */ + if (sscanf(str, "%299s %299s %299s %30d %1c", cmd, dest, src, &seq, &c) != 5) { ast_log(LOG_WARNING, "Unable to parse link string %s\n", str); return 0; } Index: apps/app_mixmonitor.c =================================================================== --- apps/app_mixmonitor.c (revision 211550) +++ apps/app_mixmonitor.c (revision 211551) @@ -426,7 +426,7 @@ if (ast_test_flag(&flags, MUXFLAG_READVOLUME)) { if (ast_strlen_zero(opts[OPT_ARG_READVOLUME])) { ast_log(LOG_WARNING, "No volume level was provided for the heard volume ('v') option.\n"); - } else if ((sscanf(opts[OPT_ARG_READVOLUME], "%d", &x) != 1) || (x < -4) || (x > 4)) { + } else if ((sscanf(opts[OPT_ARG_READVOLUME], "%2d", &x) != 1) || (x < -4) || (x > 4)) { ast_log(LOG_NOTICE, "Heard volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_READVOLUME]); } else { readvol = get_volfactor(x); @@ -436,7 +436,7 @@ if (ast_test_flag(&flags, MUXFLAG_WRITEVOLUME)) { if (ast_strlen_zero(opts[OPT_ARG_WRITEVOLUME])) { ast_log(LOG_WARNING, "No volume level was provided for the spoken volume ('V') option.\n"); - } else if ((sscanf(opts[OPT_ARG_WRITEVOLUME], "%d", &x) != 1) || (x < -4) || (x > 4)) { + } else if ((sscanf(opts[OPT_ARG_WRITEVOLUME], "%2d", &x) != 1) || (x < -4) || (x > 4)) { ast_log(LOG_NOTICE, "Spoken volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_WRITEVOLUME]); } else { writevol = get_volfactor(x); @@ -446,7 +446,7 @@ if (ast_test_flag(&flags, MUXFLAG_VOLUME)) { if (ast_strlen_zero(opts[OPT_ARG_VOLUME])) { ast_log(LOG_WARNING, "No volume level was provided for the combined volume ('W') option.\n"); - } else if ((sscanf(opts[OPT_ARG_VOLUME], "%d", &x) != 1) || (x < -4) || (x > 4)) { + } else if ((sscanf(opts[OPT_ARG_VOLUME], "%2d", &x) != 1) || (x < -4) || (x > 4)) { ast_log(LOG_NOTICE, "Combined volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_VOLUME]); } else { readvol = writevol = get_volfactor(x); Index: apps/app_readfile.c =================================================================== --- apps/app_readfile.c (revision 211550) +++ apps/app_readfile.c (revision 211551) @@ -73,7 +73,7 @@ } if (length) { - if ((sscanf(length, "%d", &len) != 1) || (len < 0)) { + if ((sscanf(length, "%30d", &len) != 1) || (len < 0)) { ast_log(LOG_WARNING, "%s is not a positive number, defaulting length to max\n", length); len = 0; } Index: apps/app_meetme.c =================================================================== --- apps/app_meetme.c (revision 211550) +++ apps/app_meetme.c (revision 211551) @@ -902,7 +902,7 @@ AST_LIST_INSERT_HEAD(&confs, cnf, list); /* Reserve conference number in map */ - if ((sscanf(cnf->confno, "%d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024)) + if ((sscanf(cnf->confno, "%30d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024)) conf_map[confno_int] = 1; cnfout: @@ -1499,7 +1499,7 @@ AST_LIST_LOCK(&confs); if (ast_atomic_dec_and_test(&conf->refcount)) { /* Take the conference room number out of an inuse state */ - if ((sscanf(conf->confno, "%d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024)) + if ((sscanf(conf->confno, "%4d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024)) conf_map[confno_int] = 0; conf_free(conf); res = 1; @@ -1663,7 +1663,7 @@ /* Possible timeout waiting for marked user */ if ((confflags & CONFFLAG_WAITMARKED) && !ast_strlen_zero(optargs[OPT_ARG_WAITMARKED]) && - (sscanf(optargs[OPT_ARG_WAITMARKED], "%d", &opt_waitmarked_timeout) == 1) && + (sscanf(optargs[OPT_ARG_WAITMARKED], "%30d", &opt_waitmarked_timeout) == 1) && (opt_waitmarked_timeout > 0)) { timeout = time(NULL) + opt_waitmarked_timeout; } @@ -3233,7 +3233,7 @@ if (!res) ast_waitstream(chan, ""); } else { - if (sscanf(confno, "%d", &confno_int) == 1) { + if (sscanf(confno, "%30d", &confno_int) == 1) { if (!ast_test_flag(&confflags, CONFFLAG_QUIET)) { res = ast_streamfile(chan, "conf-enteringno", chan->language); if (!res) { @@ -3360,7 +3360,7 @@ struct ast_conf_user *user = NULL; int cid; - sscanf(callerident, "%i", &cid); + sscanf(callerident, "%30i", &cid); if (conf && callerident) { AST_LIST_TRAVERSE(&conf->userlist, user, list) { if (cid == user->user_no) @@ -3835,7 +3835,7 @@ rt_log_members = 1; if ((val = ast_variable_retrieve(cfg, "general", "audiobuffers"))) { - if ((sscanf(val, "%d", &audio_buffers) != 1)) { + if ((sscanf(val, "%30d", &audio_buffers) != 1)) { ast_log(LOG_WARNING, "audiobuffers setting must be a number, not '%s'\n", val); audio_buffers = DEFAULT_AUDIO_BUFFERS; } else if ((audio_buffers < DAHDI_DEFAULT_NUM_BUFS) || (audio_buffers > DAHDI_MAX_NUM_BUFS)) { @@ -3852,19 +3852,19 @@ if ((val = ast_variable_retrieve(cfg, "general", "logmembercount"))) rt_log_members = ast_true(val); if ((val = ast_variable_retrieve(cfg, "general", "fuzzystart"))) { - if ((sscanf(val, "%d", &fuzzystart) != 1)) { + if ((sscanf(val, "%30d", &fuzzystart) != 1)) { ast_log(LOG_WARNING, "fuzzystart must be a number, not '%s'\n", val); fuzzystart = 0; } } if ((val = ast_variable_retrieve(cfg, "general", "earlyalert"))) { - if ((sscanf(val, "%d", &earlyalert) != 1)) { + if ((sscanf(val, "%30d", &earlyalert) != 1)) { ast_log(LOG_WARNING, "earlyalert must be a number, not '%s'\n", val); earlyalert = 0; } } if ((val = ast_variable_retrieve(cfg, "general", "endalert"))) { - if ((sscanf(val, "%d", &endalert) != 1)) { + if ((sscanf(val, "%30d", &endalert) != 1)) { ast_log(LOG_WARNING, "endalert must be a number, not '%s'\n", val); endalert = 0; } @@ -5429,7 +5429,7 @@ if (!strcasecmp(var->name, "autocontext")) ast_string_field_set(trunk, autocontext, var->value); else if (!strcasecmp(var->name, "ringtimeout")) { - if (sscanf(var->value, "%u", &trunk->ring_timeout) != 1) { + if (sscanf(var->value, "%30u", &trunk->ring_timeout) != 1) { ast_log(LOG_WARNING, "Invalid ringtimeout '%s' specified for trunk '%s'\n", var->value, trunk->name); trunk->ring_timeout = 0; @@ -5505,13 +5505,13 @@ char *name, *value = cur; name = strsep(&value, "="); if (!strcasecmp(name, "ringtimeout")) { - if (sscanf(value, "%u", &trunk_ref->ring_timeout) != 1) { + if (sscanf(value, "%30u", &trunk_ref->ring_timeout) != 1) { ast_log(LOG_WARNING, "Invalid ringtimeout value '%s' for " "trunk '%s' on station '%s'\n", value, trunk->name, station->name); trunk_ref->ring_timeout = 0; } } else if (!strcasecmp(name, "ringdelay")) { - if (sscanf(value, "%u", &trunk_ref->ring_delay) != 1) { + if (sscanf(value, "%30u", &trunk_ref->ring_delay) != 1) { ast_log(LOG_WARNING, "Invalid ringdelay value '%s' for " "trunk '%s' on station '%s'\n", value, trunk->name, station->name); trunk_ref->ring_delay = 0; @@ -5560,13 +5560,13 @@ else if (!strcasecmp(var->name, "autocontext")) ast_string_field_set(station, autocontext, var->value); else if (!strcasecmp(var->name, "ringtimeout")) { - if (sscanf(var->value, "%u", &station->ring_timeout) != 1) { + if (sscanf(var->value, "%30u", &station->ring_timeout) != 1) { ast_log(LOG_WARNING, "Invalid ringtimeout '%s' specified for station '%s'\n", var->value, station->name); station->ring_timeout = 0; } } else if (!strcasecmp(var->name, "ringdelay")) { - if (sscanf(var->value, "%u", &station->ring_delay) != 1) { + if (sscanf(var->value, "%30u", &station->ring_delay) != 1) { ast_log(LOG_WARNING, "Invalid ringdelay '%s' specified for station '%s'\n", var->value, station->name); station->ring_delay = 0; Index: apps/app_morsecode.c =================================================================== --- apps/app_morsecode.c (revision 211550) +++ apps/app_morsecode.c (revision 211551) @@ -112,13 +112,13 @@ /* Use variable MORESEDITLEN, if set (else 80) */ ditlenc = pbx_builtin_getvar_helper(chan, "MORSEDITLEN"); - if (ast_strlen_zero(ditlenc) || (sscanf(ditlenc, "%d", &ditlen) != 1)) { + if (ast_strlen_zero(ditlenc) || (sscanf(ditlenc, "%30d", &ditlen) != 1)) { ditlen = 80; } /* Use variable MORSETONE, if set (else 800) */ tonec = pbx_builtin_getvar_helper(chan, "MORSETONE"); - if (ast_strlen_zero(tonec) || (sscanf(tonec, "%d", &tone) != 1)) { + if (ast_strlen_zero(tonec) || (sscanf(tonec, "%30d", &tone) != 1)) { tone = 800; } Index: apps/app_minivm.c =================================================================== --- apps/app_minivm.c (revision 211550) +++ apps/app_minivm.c (revision 211551) @@ -1715,7 +1715,7 @@ if (ast_test_flag(&flags, OPT_RECORDGAIN)) { int gain; - if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) { + if (sscanf(opts[OPT_ARG_RECORDGAIN], "%30d", &gain) != 1) { ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]); return -1; } else @@ -2137,7 +2137,7 @@ } else if (!strcasecmp(var->name, "pager")) { ast_copy_string(vmu->pager, var->value, sizeof(vmu->pager)); } else if (!strcasecmp(var->name, "volgain")) { - sscanf(var->value, "%lf", &vmu->volgain); + sscanf(var->value, "%30lf", &vmu->volgain); } else { ast_log(LOG_ERROR, "Unknown configuration option for minivm account %s : %s\n", name, var->name); } @@ -2308,7 +2308,7 @@ global_silencethreshold = atoi(var->value); } else if (!strcmp(var->name, "maxmessage")) { int x; - if (sscanf(var->value, "%d", &x) == 1) { + if (sscanf(var->value, "%30d", &x) == 1) { global_vmmaxmessage = x; } else { error ++; @@ -2316,7 +2316,7 @@ } } else if (!strcmp(var->name, "minmessage")) { int x; - if (sscanf(var->value, "%d", &x) == 1) { + if (sscanf(var->value, "%30d", &x) == 1) { global_vmminmessage = x; if (global_maxsilence <= global_vmminmessage) ast_log(LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n"); Index: apps/app_macro.c =================================================================== --- apps/app_macro.c (revision 211550) +++ apps/app_macro.c (revision 211551) @@ -208,18 +208,18 @@ /* does the user want a deeper rabbit hole? */ s = pbx_builtin_getvar_helper(chan, "MACRO_RECURSION"); if (s) - sscanf(s, "%d", &maxdepth); + sscanf(s, "%30d", &maxdepth); /* Count how many levels deep the rabbit hole goes */ s = pbx_builtin_getvar_helper(chan, "MACRO_DEPTH"); if (s) - sscanf(s, "%d", &depth); + sscanf(s, "%30d", &depth); /* Used for detecting whether to return when a Macro is called from another Macro after hangup */ if (strcmp(chan->exten, "h") == 0) pbx_builtin_setvar_helper(chan, "MACRO_IN_HANGUP", "1"); inhangupc = pbx_builtin_getvar_helper(chan, "MACRO_IN_HANGUP"); if (!ast_strlen_zero(inhangupc)) - sscanf(inhangupc, "%d", &inhangup); + sscanf(inhangupc, "%30d", &inhangup); if (depth >= maxdepth) { ast_log(LOG_ERROR, "Macro(): possible infinite loop detected. Returning early.\n"); @@ -468,7 +468,7 @@ if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) { /* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue normally if there is any problem */ - if (sscanf(offsets, "%d", &offset) == 1) { + if (sscanf(offsets, "%30d", &offset) == 1) { if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + offset + 1, chan->cid.cid_num)) { chan->priority += offset; } Index: apps/app_sms.c =================================================================== --- apps/app_sms.c (revision 211550) +++ apps/app_sms.c (revision 211551) @@ -815,13 +815,9 @@ else if (!strcmp(line, "rp")) h->rp = (atoi(p) ? 1 : 0); else if (!strcmp(line, "scts")) { /* get date/time */ - int Y, - m, - d, - H, - M, - S; - if (sscanf (p, "%d-%d-%dT%d:%d:%d", &Y, &m, &d, &H, &M, &S) == 6) { + int Y, m, d, H, M, S; + /* XXX Why aren't we using ast_strptime here? */ + if (sscanf(p, "%4d-%2d-%2dT%2d:%2d:%2d", &Y, &m, &d, &H, &M, &S) == 6) { struct ast_tm t = { 0, }; t.tm_year = Y - 1900; t.tm_mon = m - 1; Index: apps/app_verbose.c =================================================================== --- apps/app_verbose.c (revision 211550) +++ apps/app_verbose.c (revision 211551) @@ -65,7 +65,7 @@ args.level = "0"; } - if (sscanf(args.level, "%d", &vsize) != 1) { + if (sscanf(args.level, "%30d", &vsize) != 1) { vsize = 0; ast_log(LOG_WARNING, "'%s' is not a verboser number\n", args.level); } Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 211550) +++ apps/app_voicemail.c (revision 211551) @@ -752,7 +752,7 @@ } else if (!strcasecmp(var, "sayduration")) { ast_set2_flag(vmu, ast_true(value), VM_SAYDURATION); } else if (!strcasecmp(var, "saydurationm")) { - if (sscanf(value, "%d", &x) == 1) { + if (sscanf(value, "%30d", &x) == 1) { vmu->saydurationm = x; } else { ast_log(LOG_WARNING, "Invalid min duration for say duration\n"); @@ -786,7 +786,7 @@ vmu->maxmsg = MAXMSGLIMIT; } } else if (!strcasecmp(var, "backupdeleted")) { - if (sscanf(value, "%d", &x) == 1) + if (sscanf(value, "%30d", &x) == 1) vmu->maxdeletedmsg = x; else if (ast_true(value)) vmu->maxdeletedmsg = MAXMSG; @@ -801,7 +801,7 @@ vmu->maxdeletedmsg = MAXMSGLIMIT; } } else if (!strcasecmp(var, "volgain")) { - sscanf(value, "%lf", &vmu->volgain); + sscanf(value, "%30lf", &vmu->volgain); } else if (!strcasecmp(var, "options")) { apply_options(vmu, value); } @@ -2657,7 +2657,7 @@ ast_odbc_release_obj(obj); goto yuck; } - if (sscanf(rowdata, "%d", &x) != 1) + if (sscanf(rowdata, "%30d", &x) != 1) ast_log(LOG_WARNING, "Failed to read message count!\n"); SQLFreeHandle (SQL_HANDLE_STMT, stmt); ast_odbc_release_obj(obj); @@ -2703,7 +2703,7 @@ ast_odbc_release_obj(obj); goto yuck; } - if (sscanf(rowdata, "%d", &x) != 1) + if (sscanf(rowdata, "%30d", &x) != 1) ast_log(LOG_WARNING, "Failed to read message count!\n"); SQLFreeHandle (SQL_HANDLE_STMT, stmt); ast_odbc_release_obj(obj); @@ -3033,7 +3033,7 @@ * find each file. */ msgdir = opendir(dir); while ((msgdirent = readdir(msgdir))) { - if (sscanf(msgdirent->d_name, "msg%d", &msgdirint) == 1 && msgdirint < MAXMSGLIMIT) + if (sscanf(msgdirent->d_name, "msg%30d", &msgdirint) == 1 && msgdirint < MAXMSGLIMIT) map[msgdirint] = 1; } closedir(msgdir); @@ -3320,7 +3320,7 @@ pbx_builtin_setvar_helper(ast, "ORIG_VM_CIDNUM", origcidnum); } - if ((origtime = ast_variable_retrieve(msg_cfg, "message", "origtime")) && sscanf(origtime, "%d", &inttime) == 1) { + if ((origtime = ast_variable_retrieve(msg_cfg, "message", "origtime")) && sscanf(origtime, "%30d", &inttime) == 1) { struct timeval tv = { inttime, }; struct ast_tm tm; ast_localtime(&tv, &tm, NULL); @@ -3667,7 +3667,7 @@ /* You might be tempted to do origdate, except that a) it's in the wrong * format, and b) it's missing for IMAP recordings. */ - if ((v = ast_variable_retrieve(msg_cfg, "message", "origtime")) && sscanf(v, "%d", &inttime) == 1) { + if ((v = ast_variable_retrieve(msg_cfg, "message", "origtime")) && sscanf(v, "%30d", &inttime) == 1) { struct timeval tv = { inttime, }; struct ast_tm tm; ast_localtime(&tv, &tm, NULL); @@ -7835,7 +7835,7 @@ if (ast_test_flag(&flags, OPT_RECORDGAIN)) { int gain; if (!ast_strlen_zero(opts[OPT_ARG_RECORDGAIN])) { - if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) { + if (sscanf(opts[OPT_ARG_RECORDGAIN], "%30d", &gain) != 1) { ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]); return -1; } else { @@ -7848,7 +7848,7 @@ if (ast_test_flag(&flags, OPT_AUTOPLAY) ) { play_auto = 1; if (opts[OPT_ARG_PLAYFOLDER]) { - if (sscanf(opts[OPT_ARG_PLAYFOLDER], "%d", &play_folder) != 1) { + if (sscanf(opts[OPT_ARG_PLAYFOLDER], "%30d", &play_folder) != 1) { ast_log(LOG_WARNING, "Invalid value '%s' provided for folder autoplay option\n", opts[OPT_ARG_PLAYFOLDER]); } } else { @@ -8369,7 +8369,7 @@ if (ast_test_flag(&flags, OPT_RECORDGAIN)) { int gain; - if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) { + if (sscanf(opts[OPT_ARG_RECORDGAIN], "%30d", &gain) != 1) { ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]); return -1; } else { @@ -9172,7 +9172,7 @@ volgain = 0.0; if ((val = ast_variable_retrieve(cfg, "general", "volgain"))) - sscanf(val, "%lf", &volgain); + sscanf(val, "%30lf", &volgain); #ifdef ODBC_STORAGE strcpy(odbc_database, "asterisk"); @@ -9212,7 +9212,7 @@ if (!(val = ast_variable_retrieve(cfg, "general", "backupdeleted"))) { maxdeletedmsg = 0; } else { - if (sscanf(val, "%d", &x) == 1) + if (sscanf(val, "%30d", &x) == 1) maxdeletedmsg = x; else if (ast_true(val)) maxdeletedmsg = MAXMSG; @@ -9358,7 +9358,7 @@ vmmaxsecs = 0; if ((val = ast_variable_retrieve(cfg, "general", "maxsecs"))) { - if (sscanf(val, "%d", &x) == 1) { + if (sscanf(val, "%30d", &x) == 1) { vmmaxsecs = x; } else { ast_log(LOG_WARNING, "Invalid max message time length\n"); @@ -9369,7 +9369,7 @@ maxmessage_deprecate = 1; ast_log(LOG_WARNING, "Setting 'maxmessage' has been deprecated in favor of 'maxsecs'.\n"); } - if (sscanf(val, "%d", &x) == 1) { + if (sscanf(val, "%30d", &x) == 1) { vmmaxsecs = x; } else { ast_log(LOG_WARNING, "Invalid max message time length\n"); @@ -9378,7 +9378,7 @@ vmminsecs = 0; if ((val = ast_variable_retrieve(cfg, "general", "minsecs"))) { - if (sscanf(val, "%d", &x) == 1) { + if (sscanf(val, "%30d", &x) == 1) { vmminsecs = x; if (maxsilence / 1000 >= vmminsecs) { ast_log(LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n"); @@ -9392,7 +9392,7 @@ maxmessage_deprecate = 1; ast_log(LOG_WARNING, "Setting 'minmessage' has been deprecated in favor of 'minsecs'.\n"); } - if (sscanf(val, "%d", &x) == 1) { + if (sscanf(val, "%30d", &x) == 1) { vmminsecs = x; if (maxsilence / 1000 >= vmminsecs) { ast_log(LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n"); @@ -9409,7 +9409,7 @@ skipms = 3000; if ((val = ast_variable_retrieve(cfg, "general", "maxgreet"))) { - if (sscanf(val, "%d", &x) == 1) { + if (sscanf(val, "%30d", &x) == 1) { maxgreet = x; } else { ast_log(LOG_WARNING, "Invalid max message greeting length\n"); @@ -9417,7 +9417,7 @@ } if ((val = ast_variable_retrieve(cfg, "general", "skipms"))) { - if (sscanf(val, "%d", &x) == 1) { + if (sscanf(val, "%30d", &x) == 1) { skipms = x; } else { ast_log(LOG_WARNING, "Invalid skipms value\n"); @@ -9426,7 +9426,7 @@ maxlogins = 3; if ((val = ast_variable_retrieve(cfg, "general", "maxlogins"))) { - if (sscanf(val, "%d", &x) == 1) { + if (sscanf(val, "%30d", &x) == 1) { maxlogins = x; } else { ast_log(LOG_WARNING, "Invalid max failed login attempts\n"); @@ -9511,7 +9511,7 @@ saydurationminfo = 2; if ((val = ast_variable_retrieve(cfg, "general", "saydurationm"))) { - if (sscanf(val, "%d", &x) == 1) { + if (sscanf(val, "%30d", &x) == 1) { saydurationminfo = x; } else { ast_log(LOG_WARNING, "Invalid min duration for say duration\n"); @@ -9574,7 +9574,7 @@ poll_freq = DEFAULT_POLL_FREQ; if ((val = ast_variable_retrieve(cfg, "general", "pollfreq"))) { - if (sscanf(val, "%u", &poll_freq) != 1) { + if (sscanf(val, "%30u", &poll_freq) != 1) { poll_freq = DEFAULT_POLL_FREQ; ast_log(LOG_ERROR, "'%s' is not a valid value for the pollfreq option!\n", val); } Index: apps/app_waitforsilence.c =================================================================== --- apps/app_waitforsilence.c (revision 211550) +++ apps/app_waitforsilence.c (revision 211551) @@ -157,9 +157,9 @@ res = ast_answer(chan); /* Answer the channel */ } - if (!data || ( (sscanf(data, "%d,%d,%d", &silencereqd, &iterations, &timeout) != 3) && - (sscanf(data, "%d|%d", &silencereqd, &iterations) != 2) && - (sscanf(data, "%d", &silencereqd) != 1) ) ) { + if (!data || ( (sscanf(data, "%30d,%30d,%30d", &silencereqd, &iterations, &timeout) != 3) && + (sscanf(data, "%30d,%30d", &silencereqd, &iterations) != 2) && + (sscanf(data, "%30d", &silencereqd) != 1) ) ) { ast_log(LOG_WARNING, "Using default value of 1000ms, 1 iteration, no timeout\n"); } Index: apps/app_disa.c =================================================================== --- apps/app_disa.c (revision 211550) +++ apps/app_disa.c (revision 211551) @@ -221,7 +221,7 @@ if (!(k&1)) { /* if in password state */ if (j == '#') { /* end of password */ /* see if this is an integer */ - if (sscanf(args.passcode,"%d",&j) < 1) { /* nope, it must be a filename */ + if (sscanf(args.passcode,"%30d",&j) < 1) { /* nope, it must be a filename */ fp = fopen(args.passcode,"r"); if (!fp) { ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,chan->name); @@ -247,7 +247,7 @@ ast_debug(1, "Mailbox: %s\n",args.mailbox); /* password must be in valid format (numeric) */ - if (sscanf(args.passcode,"%d", &j) < 1) + if (sscanf(args.passcode,"%30d", &j) < 1) continue; /* if we got it */ if (!strcmp(exten,args.passcode)) { Index: apps/app_osplookup.c =================================================================== --- apps/app_osplookup.c (revision 211550) +++ apps/app_osplookup.c (revision 211551) @@ -246,7 +246,7 @@ ast_log(LOG_WARNING, "OSP: Too many Service Points at line %d\n", v->lineno); } } else if (!strcasecmp(v->name, "maxconnections")) { - if ((sscanf(v->value, "%d", &t) == 1) && (t >= OSP_MIN_MAXCONNECTIONS) && (t <= OSP_MAX_MAXCONNECTIONS)) { + if ((sscanf(v->value, "%30d", &t) == 1) && (t >= OSP_MIN_MAXCONNECTIONS) && (t <= OSP_MAX_MAXCONNECTIONS)) { p->maxconnections = t; ast_debug(1, "OSP: maxconnections '%d'\n", t); } else { @@ -254,7 +254,7 @@ OSP_MIN_MAXCONNECTIONS, OSP_MAX_MAXCONNECTIONS, v->value, v->lineno); } } else if (!strcasecmp(v->name, "retrydelay")) { - if ((sscanf(v->value, "%d", &t) == 1) && (t >= OSP_MIN_RETRYDELAY) && (t <= OSP_MAX_RETRYDELAY)) { + if ((sscanf(v->value, "%30d", &t) == 1) && (t >= OSP_MIN_RETRYDELAY) && (t <= OSP_MAX_RETRYDELAY)) { p->retrydelay = t; ast_debug(1, "OSP: retrydelay '%d'\n", t); } else { @@ -262,7 +262,7 @@ OSP_MIN_RETRYDELAY, OSP_MAX_RETRYDELAY, v->value, v->lineno); } } else if (!strcasecmp(v->name, "retrylimit")) { - if ((sscanf(v->value, "%d", &t) == 1) && (t >= OSP_MIN_RETRYLIMIT) && (t <= OSP_MAX_RETRYLIMIT)) { + if ((sscanf(v->value, "%30d", &t) == 1) && (t >= OSP_MIN_RETRYLIMIT) && (t <= OSP_MAX_RETRYLIMIT)) { p->retrylimit = t; ast_debug(1, "OSP: retrylimit '%d'\n", t); } else { @@ -270,7 +270,7 @@ OSP_MIN_RETRYLIMIT, OSP_MAX_RETRYLIMIT, v->value, v->lineno); } } else if (!strcasecmp(v->name, "timeout")) { - if ((sscanf(v->value, "%d", &t) == 1) && (t >= OSP_MIN_TIMEOUT) && (t <= OSP_MAX_TIMEOUT)) { + if ((sscanf(v->value, "%30d", &t) == 1) && (t >= OSP_MIN_TIMEOUT) && (t <= OSP_MAX_TIMEOUT)) { p->timeout = t; ast_debug(1, "OSP: timeout '%d'\n", t); } else { @@ -281,7 +281,7 @@ ast_copy_string(p->source, v->value, sizeof(p->source)); ast_debug(1, "OSP: source '%s'\n", p->source); } else if (!strcasecmp(v->name, "authpolicy")) { - if ((sscanf(v->value, "%d", &t) == 1) && ((t == OSP_AUTH_NO) || (t == OSP_AUTH_YES) || (t == OSP_AUTH_EXCLUSIVE))) { + if ((sscanf(v->value, "%30d", &t) == 1) && ((t == OSP_AUTH_NO) || (t == OSP_AUTH_YES) || (t == OSP_AUTH_EXCLUSIVE))) { p->authpolicy = t; ast_debug(1, "OSP: authpolicy '%d'\n", t); } else { @@ -1391,11 +1391,11 @@ headp = &chan->varshead; AST_LIST_TRAVERSE(headp, current, entries) { if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) { - if (sscanf(ast_var_value(current), "%d", &result.inhandle) != 1) { + if (sscanf(ast_var_value(current), "%30d", &result.inhandle) != 1) { result.inhandle = OSP_INVALID_HANDLE; } } else if (!strcasecmp(ast_var_name(current), "OSPINTIMELIMIT")) { - if (sscanf(ast_var_value(current), "%d", &result.intimelimit) != 1) { + if (sscanf(ast_var_value(current), "%30d", &result.intimelimit) != 1) { result.intimelimit = OSP_DEF_TIMELIMIT; } } else if (!strcasecmp(ast_var_name(current), "OSPINNETWORKID")) { @@ -1532,7 +1532,7 @@ AST_STANDARD_APP_ARGS(args, tmp); - if (!ast_strlen_zero(args.cause) && sscanf(args.cause, "%d", &cause) != 1) { + if (!ast_strlen_zero(args.cause) && sscanf(args.cause, "%30d", &cause) != 1) { cause = 0; } ast_debug(1, "OSPNext: cause '%d'\n", cause); @@ -1550,23 +1550,23 @@ headp = &chan->varshead; AST_LIST_TRAVERSE(headp, current, entries) { if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) { - if (sscanf(ast_var_value(current), "%d", &result.inhandle) != 1) { + if (sscanf(ast_var_value(current), "%30d", &result.inhandle) != 1) { result.inhandle = OSP_INVALID_HANDLE; } } else if (!strcasecmp(ast_var_name(current), "OSPOUTHANDLE")) { - if (sscanf(ast_var_value(current), "%d", &result.outhandle) != 1) { + if (sscanf(ast_var_value(current), "%30d", &result.outhandle) != 1) { result.outhandle = OSP_INVALID_HANDLE; } } else if (!strcasecmp(ast_var_name(current), "OSPINTIMELIMIT")) { - if (sscanf(ast_var_value(current), "%d", &result.intimelimit) != 1) { + if (sscanf(ast_var_value(current), "%30d", &result.intimelimit) != 1) { result.intimelimit = OSP_DEF_TIMELIMIT; } } else if (!strcasecmp(ast_var_name(current), "OSPOUTCALLIDTYPES")) { - if (sscanf(ast_var_value(current), "%d", &callidtypes) != 1) { + if (sscanf(ast_var_value(current), "%30d", &callidtypes) != 1) { callidtypes = OSP_CALLID_UNDEFINED; } } else if (!strcasecmp(ast_var_name(current), "OSPRESULTS")) { - if (sscanf(ast_var_value(current), "%d", &result.numresults) != 1) { + if (sscanf(ast_var_value(current), "%30d", &result.numresults) != 1) { result.numresults = 0; } } @@ -1685,11 +1685,11 @@ headp = &chan->varshead; AST_LIST_TRAVERSE(headp, current, entries) { if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) { - if (sscanf(ast_var_value(current), "%d", &inhandle) != 1) { + if (sscanf(ast_var_value(current), "%30d", &inhandle) != 1) { inhandle = OSP_INVALID_HANDLE; } } else if (!strcasecmp(ast_var_name(current), "OSPOUTHANDLE")) { - if (sscanf(ast_var_value(current), "%d", &outhandle) != 1) { + if (sscanf(ast_var_value(current), "%30d", &outhandle) != 1) { outhandle = OSP_INVALID_HANDLE; } } else if (!recorded && @@ -1706,7 +1706,7 @@ ast_debug(1, "OSPFinish: OSPOUTHANDLE '%d'\n", outhandle); ast_debug(1, "OSPFinish: recorded '%d'\n", recorded); - if (!ast_strlen_zero(args.cause) && sscanf(args.cause, "%d", &cause) != 1) { + if (!ast_strlen_zero(args.cause) && sscanf(args.cause, "%30d", &cause) != 1) { cause = 0; } ast_debug(1, "OSPFinish: cause '%d'\n", cause); @@ -1798,7 +1798,7 @@ t = ast_variable_retrieve(cfg, OSP_GENERAL_CAT, "tokenformat"); if (t) { - if ((sscanf(t, "%d", &v) == 1) && + if ((sscanf(t, "%30d", &v) == 1) && ((v == TOKEN_ALGO_SIGNED) || (v == TOKEN_ALGO_UNSIGNED) || (v == TOKEN_ALGO_BOTH))) { osp_tokenformat = v; Index: apps/app_dahdibarge.c =================================================================== --- apps/app_dahdibarge.c (revision 211550) +++ apps/app_dahdibarge.c (revision 211551) @@ -259,8 +259,8 @@ char confstr[80] = ""; if (!ast_strlen_zero(data)) { - if ((sscanf(data, "DAHDI/%d", &confno) != 1) && - (sscanf(data, "%d", &confno) != 1)) { + if ((sscanf(data, "DAHDI/%30d", &confno) != 1) && + (sscanf(data, "%30d", &confno) != 1)) { ast_log(LOG_WARNING, "DAHDIBarge Argument (if specified) must be a channel number, not '%s'\n", (char *)data); return 0; } @@ -274,7 +274,7 @@ confstr[0] = '\0'; res = ast_app_getdata(chan, "conf-getchannel",confstr, sizeof(confstr) - 1, 0); if (res <0) goto out; - if (sscanf(confstr, "%d", &confno) != 1) + if (sscanf(confstr, "%30d", &confno) != 1) confno = 0; } if (confno) { Index: apps/app_privacy.c =================================================================== --- apps/app_privacy.c (revision 211550) +++ apps/app_privacy.c (revision 211551) @@ -90,13 +90,13 @@ AST_STANDARD_APP_ARGS(args, parse); if (args.maxretries) { - if (sscanf(args.maxretries, "%d", &x) == 1) + if (sscanf(args.maxretries, "%30d", &x) == 1) maxretries = x; else ast_log(LOG_WARNING, "Invalid max retries argument\n"); } if (args.minlength) { - if (sscanf(args.minlength, "%d", &x) == 1) + if (sscanf(args.minlength, "%30d", &x) == 1) minlength = x; else ast_log(LOG_WARNING, "Invalid min length argument\n"); Index: apps/app_record.c =================================================================== --- apps/app_record.c (revision 211550) +++ apps/app_record.c (revision 211551) @@ -145,7 +145,7 @@ return -1; } if (args.silence) { - if ((sscanf(args.silence, "%d", &i) == 1) && (i > -1)) { + if ((sscanf(args.silence, "%30d", &i) == 1) && (i > -1)) { silence = i * 1000; } else if (!ast_strlen_zero(args.silence)) { ast_log(LOG_WARNING, "'%s' is not a valid silence duration\n", args.silence); @@ -153,7 +153,7 @@ } if (args.maxduration) { - if ((sscanf(args.maxduration, "%d", &i) == 1) && (i > -1)) + if ((sscanf(args.maxduration, "%30d", &i) == 1) && (i > -1)) /* Convert duration to milliseconds */ maxduration = i * 1000; else if (!ast_strlen_zero(args.maxduration)) Index: apps/app_waituntil.c =================================================================== --- apps/app_waituntil.c (revision 211550) +++ apps/app_waituntil.c (revision 211551) @@ -58,7 +58,7 @@ return 0; } - if (sscanf(data, "%ld%lf", (long *)&future.tv_sec, &fraction) == 0) { + if (sscanf(data, "%30ld%30lf", (long *)&future.tv_sec, &fraction) == 0) { ast_log(LOG_WARNING, "WaitUntil called with non-numeric argument\n"); pbx_builtin_setvar_helper(chan, "WAITUNTILSTATUS", "FAILURE"); return 0; Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 211550) +++ apps/app_queue.c (revision 211551) @@ -4588,7 +4588,7 @@ } if (!ast_strlen_zero(args.penalty)) { - if ((sscanf(args.penalty, "%d", &penalty) != 1) || penalty < 0) { + if ((sscanf(args.penalty, "%30d", &penalty) != 1) || penalty < 0) { ast_log(LOG_WARNING, "Penalty '%s' is invalid, must be an integer >= 0\n", args.penalty); penalty = 0; } @@ -4749,7 +4749,7 @@ /* Get the priority from the variable ${QUEUE_PRIO} */ user_priority = pbx_builtin_getvar_helper(chan, "QUEUE_PRIO"); if (user_priority) { - if (sscanf(user_priority, "%d", &prio) == 1) { + if (sscanf(user_priority, "%30d", &prio) == 1) { ast_debug(1, "%s: Got priority %d from ${QUEUE_PRIO}.\n", chan->name, prio); } else { ast_log(LOG_WARNING, "${QUEUE_PRIO}: Invalid value (%s), channel %s.\n", @@ -4764,7 +4764,7 @@ /* Get the maximum penalty from the variable ${QUEUE_MAX_PENALTY} */ if ((max_penalty_str = pbx_builtin_getvar_helper(chan, "QUEUE_MAX_PENALTY"))) { - if (sscanf(max_penalty_str, "%d", &max_penalty) == 1) { + if (sscanf(max_penalty_str, "%30d", &max_penalty) == 1) { ast_debug(1, "%s: Got max penalty %d from ${QUEUE_MAX_PENALTY}.\n", chan->name, max_penalty); } else { ast_log(LOG_WARNING, "${QUEUE_MAX_PENALTY}: Invalid value (%s), channel %s.\n", @@ -4776,7 +4776,7 @@ } if ((min_penalty_str = pbx_builtin_getvar_helper(chan, "QUEUE_MIN_PENALTY"))) { - if (sscanf(min_penalty_str, "%d", &min_penalty) == 1) { + if (sscanf(min_penalty_str, "%30d", &min_penalty) == 1) { ast_debug(1, "%s: Got min penalty %d from ${QUEUE_MIN_PENALTY}.\n", chan->name, min_penalty); } else { ast_log(LOG_WARNING, "${QUEUE_MIN_PENALTY}: Invalid value (%s), channel %s.\n", @@ -6046,7 +6046,7 @@ if (ast_strlen_zero(penalty_s)) penalty = 0; - else if (sscanf(penalty_s, "%d", &penalty) != 1 || penalty < 0) + else if (sscanf(penalty_s, "%30d", &penalty) != 1 || penalty < 0) penalty = 0; if (ast_strlen_zero(paused_s)) @@ -6238,7 +6238,7 @@ queuename = a->argv[5]; interface = a->argv[3]; if (a->argc >= 8) { - if (sscanf(a->argv[7], "%d", &penalty) == 1) { + if (sscanf(a->argv[7], "%30d", &penalty) == 1) { if (penalty < 0) { ast_cli(a->fd, "Penalty must be >= 0\n"); penalty = 0; Index: apps/app_followme.c =================================================================== --- apps/app_followme.c (revision 211550) +++ apps/app_followme.c (revision 211551) @@ -308,7 +308,7 @@ featuredigittostr = ast_variable_retrieve(cfg, "general", "featuredigittimeout"); if (!ast_strlen_zero(featuredigittostr)) { - if (!sscanf(featuredigittostr, "%d", &featuredigittimeout)) + if (!sscanf(featuredigittostr, "%30d", &featuredigittimeout)) featuredigittimeout = 5000; } Index: apps/app_waitforring.c =================================================================== --- apps/app_waitforring.c (revision 211550) +++ apps/app_waitforring.c (revision 211551) @@ -52,7 +52,7 @@ double s; int ms; - if (!data || (sscanf(data, "%lg", &s) != 1)) { + if (!data || (sscanf(data, "%30lg", &s) != 1)) { ast_log(LOG_WARNING, "WaitForRing requires an argument (minimum seconds)\n"); return 0; } Index: doc/CODING-GUIDELINES =================================================================== --- doc/CODING-GUIDELINES (revision 211550) +++ doc/CODING-GUIDELINES (revision 211551) @@ -370,6 +370,17 @@ use a direct strcpy(), as it can be inlined and optimized to simple processor operations, unlike ast_copy_string(). +* String conversions +-------------------- + +When converting from strings to integers or floats, use the sscanf function +in preference to the atoi and atof family of functions, as sscanf detects +errors. Always check the return value of sscanf to verify that your numeric +variables successfully scanned before using them. Also, to avoid a potential +libc bug, always specify a maximum width for each format specifier, including +integers and floats. A good length for both integers and floats is 30, as +this is more than generous, even if you're using doubles or long integers. + * Use of functions ------------------ Index: funcs/func_rand.c =================================================================== --- funcs/func_rand.c (revision 211550) +++ funcs/func_rand.c (revision 211551) @@ -45,10 +45,10 @@ 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) { Index: funcs/func_strings.c =================================================================== --- funcs/func_strings.c (revision 211550) +++ funcs/func_strings.c (revision 211551) @@ -485,7 +485,7 @@ /* 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 @@ /* 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; } Index: funcs/func_enum.c =================================================================== --- funcs/func_enum.c (revision 211550) +++ funcs/func_enum.c (revision 211551) @@ -258,7 +258,7 @@ 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; } Index: funcs/func_odbc.c =================================================================== --- funcs/func_odbc.c (revision 211550) +++ funcs/func_odbc.c (revision 211551) @@ -671,7 +671,7 @@ 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)); Index: funcs/func_dialplan.c =================================================================== --- funcs/func_dialplan.c (revision 211550) +++ funcs/func_dialplan.c (revision 211551) @@ -55,7 +55,7 @@ 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); Index: funcs/func_math.c =================================================================== --- funcs/func_math.c (revision 211550) +++ funcs/func_math.c (revision 211551) @@ -190,12 +190,12 @@ 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; } Index: funcs/func_cut.c =================================================================== --- funcs/func_cut.c (revision 211550) +++ funcs/func_cut.c (revision 211551) @@ -89,7 +89,7 @@ } *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 @@ 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 { Index: funcs/func_channel.c =================================================================== --- funcs/func_channel.c (revision 211550) +++ funcs/func_channel.c (revision 211551) @@ -136,10 +136,10 @@ } 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; Index: main/utils.c =================================================================== --- main/utils.c (revision 211550) +++ main/utils.c (revision 211551) @@ -1607,7 +1607,7 @@ return -1; /* only integer at the moment, but one day we could accept more formats */ - if (sscanf(src, "%Lf%n", &dtv, &scanned) > 0) { + if (sscanf(src, "%30Lf%n", &dtv, &scanned) > 0) { dst->tv_sec = dtv; dst->tv_usec = (dtv - dst->tv_sec) * 1000000.0; if (consumed) @@ -1634,7 +1634,7 @@ return -1; /* only integer at the moment, but one day we could accept more formats */ - if (sscanf(src, "%ld%n", &t, &scanned) == 1) { + if (sscanf(src, "%30ld%n", &t, &scanned) == 1) { *dst = t; if (consumed) *consumed = scanned; Index: main/config.c =================================================================== --- main/config.c (revision 211550) +++ main/config.c (revision 211551) @@ -343,7 +343,7 @@ int lineno; int insertline; - if (!variable || sscanf(line, "%d", &insertline) != 1) + if (!variable || sscanf(line, "%30d", &insertline) != 1) return; if (!insertline) { variable->next = category->root; Index: main/cdr.c =================================================================== --- main/cdr.c (revision 211550) +++ main/cdr.c (revision 211551) @@ -1439,7 +1439,7 @@ batchsafeshutdown = ast_true(batchsafeshutdown_value); } if ((size_value = ast_variable_retrieve(config, "general", "size"))) { - if (sscanf(size_value, "%d", &cfg_size) < 1) + if (sscanf(size_value, "%30d", &cfg_size) < 1) ast_log(LOG_WARNING, "Unable to convert '%s' to a numeric value.\n", size_value); else if (cfg_size < 0) ast_log(LOG_WARNING, "Invalid maximum batch size '%d' specified, using default\n", cfg_size); @@ -1447,7 +1447,7 @@ batchsize = cfg_size; } if ((time_value = ast_variable_retrieve(config, "general", "time"))) { - if (sscanf(time_value, "%d", &cfg_time) < 1) + if (sscanf(time_value, "%30d", &cfg_time) < 1) ast_log(LOG_WARNING, "Unable to convert '%s' to a numeric value.\n", time_value); else if (cfg_time < 0) ast_log(LOG_WARNING, "Invalid maximum batch time '%d' specified, using default\n", cfg_time); Index: main/channel.c =================================================================== --- main/channel.c (revision 211550) +++ main/channel.c (revision 211551) @@ -5344,9 +5344,9 @@ c = ast_strdupa(s); while ((piece = strsep(&c, ","))) { - if (sscanf(piece, "%d-%d", &start, &finish) == 2) { + if (sscanf(piece, "%30d-%30d", &start, &finish) == 2) { /* Range */ - } else if (sscanf(piece, "%d", &start)) { + } else if (sscanf(piece, "%30d", &start)) { /* Just one */ finish = start; } else { Index: main/manager.c =================================================================== --- main/manager.c (revision 211550) +++ main/manager.c (revision 211551) @@ -1495,7 +1495,7 @@ idText[0] = '\0'; if (!ast_strlen_zero(timeouts)) { - sscanf(timeouts, "%i", &timeout); + sscanf(timeouts, "%30i", &timeout); if (timeout < -1) timeout = -1; /* XXX maybe put an upper bound, or prevent the use of 0 ? */ @@ -1939,7 +1939,7 @@ astman_send_error(s, m, "Channel not specified"); return 0; } - if (!ast_strlen_zero(priority) && (sscanf(priority, "%d", &pi) != 1)) { + if (!ast_strlen_zero(priority) && (sscanf(priority, "%30d", &pi) != 1)) { if ((pi = ast_findlabel_extension(NULL, context, exten, priority, NULL)) < 1) { astman_send_error(s, m, "Invalid priority"); return 0; @@ -2203,13 +2203,13 @@ astman_send_error(s, m, "Channel not specified"); return 0; } - if (!ast_strlen_zero(priority) && (sscanf(priority, "%d", &pi) != 1)) { + if (!ast_strlen_zero(priority) && (sscanf(priority, "%30d", &pi) != 1)) { if ((pi = ast_findlabel_extension(NULL, context, exten, priority, NULL)) < 1) { astman_send_error(s, m, "Invalid priority"); return 0; } } - if (!ast_strlen_zero(timeout) && (sscanf(timeout, "%d", &to) != 1)) { + if (!ast_strlen_zero(timeout) && (sscanf(timeout, "%30d", &to) != 1)) { astman_send_error(s, m, "Invalid timeout"); return 0; } @@ -3582,7 +3582,7 @@ for (v = params; v; v = v->next) { if (!strcasecmp(v->name, "mansession_id")) { - sscanf(v->value, "%x", &ident); + sscanf(v->value, "%30x", &ident); break; } } Index: main/features.c =================================================================== --- main/features.c (revision 211550) +++ main/features.c (revision 211551) @@ -438,7 +438,7 @@ * limitation here. If extout was not numeric, we could permit * arbitrary non-numeric extensions. */ - if (sscanf(parkingexten, "%d", &parking_space) != 1 || parking_space < 0) { + if (sscanf(parkingexten, "%30d", &parking_space) != 1 || parking_space < 0) { AST_LIST_UNLOCK(&parkinglot); ast_free(pu); ast_log(LOG_WARNING, "PARKINGEXTEN does not indicate a valid parking slot: '%s'.\n", parkingexten); @@ -3189,13 +3189,13 @@ } else if (!strcasecmp(var->name, "context")) { ast_copy_string(parking_con, var->value, sizeof(parking_con)); } else if (!strcasecmp(var->name, "parkingtime")) { - if ((sscanf(var->value, "%d", &parkingtime) != 1) || (parkingtime < 1)) { + if ((sscanf(var->value, "%30d", &parkingtime) != 1) || (parkingtime < 1)) { ast_log(LOG_WARNING, "%s is not a valid parkingtime\n", var->value); parkingtime = DEFAULT_PARK_TIME; } else parkingtime = parkingtime * 1000; } else if (!strcasecmp(var->name, "parkpos")) { - if (sscanf(var->value, "%d-%d", &start, &end) != 2) { + if (sscanf(var->value, "%30d-%30d", &start, &end) != 2) { ast_log(LOG_WARNING, "Format for parking positions is a-b, where a and b are numbers at line %d of features.conf\n", var->lineno); } else { parking_start = start; @@ -3236,24 +3236,24 @@ } else if (!strcasecmp(var->name, "adsipark")) { adsipark = ast_true(var->value); } else if (!strcasecmp(var->name, "transferdigittimeout")) { - if ((sscanf(var->value, "%d", &transferdigittimeout) != 1) || (transferdigittimeout < 1)) { + if ((sscanf(var->value, "%30d", &transferdigittimeout) != 1) || (transferdigittimeout < 1)) { ast_log(LOG_WARNING, "%s is not a valid transferdigittimeout\n", var->value); transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT; } else transferdigittimeout = transferdigittimeout * 1000; } else if (!strcasecmp(var->name, "featuredigittimeout")) { - if ((sscanf(var->value, "%d", &featuredigittimeout) != 1) || (featuredigittimeout < 1)) { + if ((sscanf(var->value, "%30d", &featuredigittimeout) != 1) || (featuredigittimeout < 1)) { ast_log(LOG_WARNING, "%s is not a valid featuredigittimeout\n", var->value); featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT; } } else if (!strcasecmp(var->name, "atxfernoanswertimeout")) { - if ((sscanf(var->value, "%d", &atxfernoanswertimeout) != 1) || (atxfernoanswertimeout < 1)) { + if ((sscanf(var->value, "%30d", &atxfernoanswertimeout) != 1) || (atxfernoanswertimeout < 1)) { ast_log(LOG_WARNING, "%s is not a valid atxfernoanswertimeout\n", var->value); atxfernoanswertimeout = DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER; } else atxfernoanswertimeout = atxfernoanswertimeout * 1000; } else if (!strcasecmp(var->name, "atxferloopdelay")) { - if ((sscanf(var->value, "%u", &atxferloopdelay) != 1)) { + if ((sscanf(var->value, "%30u", &atxferloopdelay) != 1)) { ast_log(LOG_WARNING, "%s is not a valid atxferloopdelay\n", var->value); atxferloopdelay = DEFAULT_ATXFER_LOOP_DELAY; } else @@ -3261,7 +3261,7 @@ } else if (!strcasecmp(var->name, "atxferdropcall")) { atxferdropcall = ast_true(var->value); } else if (!strcasecmp(var->name, "atxfercallbackretries")) { - if ((sscanf(var->value, "%u", &atxferloopdelay) != 1)) { + if ((sscanf(var->value, "%30u", &atxferloopdelay) != 1)) { ast_log(LOG_WARNING, "%s is not a valid atxfercallbackretries\n", var->value); atxfercallbackretries = DEFAULT_ATXFER_CALLBACK_RETRIES; } @@ -3832,7 +3832,7 @@ } if (!ast_strlen_zero(timeout)) { - sscanf(timeout, "%d", &to); + sscanf(timeout, "%30d", &to); } res = ast_masq_park_call(ch1, ch2, to, &parkExt); Index: main/http.c =================================================================== --- main/http.c (revision 211550) +++ main/http.c (revision 211551) @@ -150,10 +150,10 @@ while (sid && strcmp(sid->name, "mansession_id")) sid = sid->next; - - if (!sid || sscanf(sid->value, "%x", &mngid) != 1) + + if (!sid || sscanf(sid->value, "%30x", &mngid) != 1) return 0; - + return mngid; } @@ -489,7 +489,7 @@ if (strcasecmp(var->name, "mansession_id")) continue; - if (sscanf(var->value, "%lx", &ident) != 1) { + if (sscanf(var->value, "%30lx", &ident) != 1) { *status = 400; *title = ast_strdup("Bad Request"); return ast_http_error(400, "Bad Request", NULL, "The was an error parsing the request."); @@ -514,7 +514,7 @@ for (var = headers; var; var = var->next) { if (!strcasecmp(var->name, "Content-Length")) { - if ((sscanf(var->value, "%u", &content_len)) != 1) { + if ((sscanf(var->value, "%30u", &content_len)) != 1) { ast_log(LOG_ERROR, "Invalid Content-Length in POST request!\n"); fclose(f); return NULL; Index: main/acl.c =================================================================== --- main/acl.c (revision 211550) +++ main/acl.c (revision 211551) @@ -291,7 +291,7 @@ nm++; if (!strchr(nm, '.')) { - if ((sscanf(nm, "%d", &x) == 1) && (x >= 0) && (x <= 32)) + if ((sscanf(nm, "%30d", &x) == 1) && (x >= 0) && (x <= 32)) ha->netmask.s_addr = htonl(0xFFFFFFFF << (32 - x)); else { ast_log(LOG_WARNING, "Invalid CIDR in %s\n", stuff); @@ -413,14 +413,14 @@ int ast_str2cos(const char *value, unsigned int *cos) { int fval; - - if (sscanf(value, "%d", &fval) == 1) { + + if (sscanf(value, "%30d", &fval) == 1) { if (fval < 8) { - *cos = fval; + *cos = fval; return 0; } } - + return -1; } @@ -429,7 +429,7 @@ int fval; unsigned int x; - if (sscanf(value, "%i", &fval) == 1) { + if (sscanf(value, "%30i", &fval) == 1) { *tos = fval & 0xFF; return 0; } Index: main/asterisk.c =================================================================== --- main/asterisk.c (revision 211550) +++ main/asterisk.c (revision 211551) @@ -1164,7 +1164,7 @@ if (!ast_strlen_zero(ast_config_AST_CTL_PERMISSIONS)) { int p1; mode_t p; - sscanf(ast_config_AST_CTL_PERMISSIONS, "%o", &p1); + sscanf(ast_config_AST_CTL_PERMISSIONS, "%30o", &p1); p = p1; if ((chmod(ast_config_AST_SOCKET, p)) < 0) ast_log(LOG_WARNING, "Unable to change file permissions of %s: %s\n", ast_config_AST_SOCKET, strerror(errno)); @@ -2024,10 +2024,10 @@ switch (*t) { case 'C': /* color */ t++; - if (sscanf(t, "%d;%d%n", &fgcolor, &bgcolor, &i) == 2) { + if (sscanf(t, "%30d;%30d%n", &fgcolor, &bgcolor, &i) == 2) { strncat(p, term_color_code(term_code, fgcolor, bgcolor, sizeof(term_code)),sizeof(prompt) - strlen(prompt) - 1); t += i - 1; - } else if (sscanf(t, "%d%n", &fgcolor, &i) == 1) { + } else if (sscanf(t, "%30d%n", &fgcolor, &i) == 1) { strncat(p, term_color_code(term_code, fgcolor, 0, sizeof(term_code)),sizeof(prompt) - strlen(prompt) - 1); t += i - 1; } @@ -2064,13 +2064,13 @@ float avg1, avg2, avg3; int actproc, totproc, npid, which; - if (fscanf(LOADAVG, "%f %f %f %d/%d %d", + if (fscanf(LOADAVG, "%30f %30f %30f %30d/%30d %30d", &avg1, &avg2, &avg3, &actproc, &totproc, &npid) != 6) { ast_log(LOG_WARNING, "parsing /proc/loadavg failed\n"); fclose(LOADAVG); break; } - if (sscanf(t, "%d", &which) == 1) { + if (sscanf(t, "%1d", &which) == 1) { switch (which) { case 1: snprintf(p, sizeof(prompt) - strlen(prompt), "%.2f", avg1); @@ -2722,7 +2722,7 @@ /* debug level (-d at startup) */ } else if (!strcasecmp(v->name, "debug")) { option_debug = 0; - if (sscanf(v->value, "%d", &option_debug) != 1) { + if (sscanf(v->value, "%30d", &option_debug) != 1) { option_debug = ast_true(v->value); } #if HAVE_WORKING_FORK @@ -2770,7 +2770,7 @@ } else if (!strcasecmp(v->name, "internal_timing")) { ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_INTERNAL_TIMING); } else if (!strcasecmp(v->name, "maxcalls")) { - if ((sscanf(v->value, "%d", &option_maxcalls) != 1) || (option_maxcalls < 0)) { + if ((sscanf(v->value, "%30d", &option_maxcalls) != 1) || (option_maxcalls < 0)) { option_maxcalls = 0; } } else if (!strcasecmp(v->name, "maxload")) { @@ -2779,7 +2779,7 @@ if (getloadavg(test, 1) == -1) { ast_log(LOG_ERROR, "Cannot obtain load average on this system. 'maxload' option disabled.\n"); option_maxload = 0.0; - } else if ((sscanf(v->value, "%lf", &option_maxload) != 1) || (option_maxload < 0.0)) { + } else if ((sscanf(v->value, "%30lf", &option_maxload) != 1) || (option_maxload < 0.0)) { option_maxload = 0.0; } /* Set the maximum amount of open files */ @@ -2821,7 +2821,7 @@ } else if (!strcasecmp(v->name, "minmemfree")) { /* specify the minimum amount of free memory to retain. Asterisk should stop accepting new calls * if the amount of free memory falls below this watermark */ - if ((sscanf(v->value, "%ld", &option_minmemfree) != 1) || (option_minmemfree < 0)) { + if ((sscanf(v->value, "%30ld", &option_minmemfree) != 1) || (option_minmemfree < 0)) { option_minmemfree = 0; } #endif @@ -2829,7 +2829,7 @@ } for (v = ast_variable_browse(cfg, "compat"); v; v = v->next) { float version; - if (sscanf(v->value, "%f", &version) != 1) { + if (sscanf(v->value, "%30f", &version) != 1) { ast_log(LOG_WARNING, "Compatibility version for option '%s' is not a number: '%s'\n", v->name, v->value); continue; } @@ -2969,7 +2969,7 @@ switch (c) { #if defined(HAVE_SYSINFO) case 'e': - if ((sscanf(&optarg[1], "%ld", &option_minmemfree) != 1) || (option_minmemfree < 0)) { + if ((sscanf(&optarg[1], "%30ld", &option_minmemfree) != 1) || (option_minmemfree < 0)) { option_minmemfree = 0; } break; @@ -3009,11 +3009,11 @@ ast_set_flag(&ast_options, AST_OPT_FLAG_MUTE); break; case 'M': - if ((sscanf(optarg, "%d", &option_maxcalls) != 1) || (option_maxcalls < 0)) + if ((sscanf(optarg, "%30d", &option_maxcalls) != 1) || (option_maxcalls < 0)) option_maxcalls = 0; break; case 'L': - if ((sscanf(optarg, "%lf", &option_maxload) != 1) || (option_maxload < 0.0)) + if ((sscanf(optarg, "%30lf", &option_maxload) != 1) || (option_maxload < 0.0)) option_maxload = 0.0; break; case 'q': Index: main/frame.c =================================================================== --- main/frame.c (revision 211550) +++ main/frame.c (revision 211551) @@ -729,7 +729,7 @@ if (a->argc != 4) return CLI_SHOWUSAGE; - if (sscanf(a->argv[3],"%d",&codec) != 1) + if (sscanf(a->argv[3], "%30d", &codec) != 1) return CLI_SHOWUSAGE; for (i = 0; i < 32; i++) Index: main/indications.c =================================================================== --- main/indications.c (revision 211550) +++ main/indications.c (revision 211551) @@ -239,46 +239,46 @@ s++; else if (d.reppos == -1) d.reppos = d.nitems; - if (sscanf(s, "%d+%d/%d", &freq1, &freq2, &time) == 3) { + if (sscanf(s, "%30d+%30d/%30d", &freq1, &freq2, &time) == 3) { /* f1+f2/time format */ - } else if (sscanf(s, "%d+%d", &freq1, &freq2) == 2) { + } else if (sscanf(s, "%30d+%30d", &freq1, &freq2) == 2) { /* f1+f2 format */ time = 0; - } else if (sscanf(s, "%d*%d/%d", &freq1, &freq2, &time) == 3) { + } else if (sscanf(s, "%30d*%30d/%30d", &freq1, &freq2, &time) == 3) { /* f1*f2/time format */ modulate = 1; - } else if (sscanf(s, "%d*%d", &freq1, &freq2) == 2) { + } else if (sscanf(s, "%30d*%30d", &freq1, &freq2) == 2) { /* f1*f2 format */ time = 0; modulate = 1; - } else if (sscanf(s, "%d/%d", &freq1, &time) == 2) { + } else if (sscanf(s, "%30d/%30d", &freq1, &time) == 2) { /* f1/time format */ freq2 = 0; - } else if (sscanf(s, "%d", &freq1) == 1) { + } else if (sscanf(s, "%30d", &freq1) == 1) { /* f1 format */ freq2 = 0; time = 0; - } else if (sscanf(s, "M%d+M%d/%d", &freq1, &freq2, &time) == 3) { + } else if (sscanf(s, "M%30d+M%30d/%30d", &freq1, &freq2, &time) == 3) { /* Mf1+Mf2/time format */ midinote = 1; - } else if (sscanf(s, "M%d+M%d", &freq1, &freq2) == 2) { + } else if (sscanf(s, "M%30d+M%30d", &freq1, &freq2) == 2) { /* Mf1+Mf2 format */ time = 0; midinote = 1; - } else if (sscanf(s, "M%d*M%d/%d", &freq1, &freq2, &time) == 3) { + } else if (sscanf(s, "M%30d*M%30d/%30d", &freq1, &freq2, &time) == 3) { /* Mf1*Mf2/time format */ modulate = 1; midinote = 1; - } else if (sscanf(s, "M%d*M%d", &freq1, &freq2) == 2) { + } else if (sscanf(s, "M%30d*M%30d", &freq1, &freq2) == 2) { /* Mf1*Mf2 format */ time = 0; modulate = 1; midinote = 1; - } else if (sscanf(s, "M%d/%d", &freq1, &time) == 2) { + } else if (sscanf(s, "M%30d/%30d", &freq1, &time) == 2) { /* Mf1/time format */ freq2 = -1; midinote = 1; - } else if (sscanf(s, "M%d", &freq1) == 1) { + } else if (sscanf(s, "M%30d", &freq1) == 1) { /* Mf1 format */ freq2 = -1; time = 0; Index: main/cli.c =================================================================== --- main/cli.c (revision 211550) +++ main/cli.c (revision 211551) @@ -296,7 +296,7 @@ atleast = 1; if (argc != e->args + atleast && argc != e->args + atleast + 1) return CLI_SHOWUSAGE; - if (sscanf(argv[e->args + atleast - 1], "%d", &newlevel) != 1) + if (sscanf(argv[e->args + atleast - 1], "%30d", &newlevel) != 1) return CLI_SHOWUSAGE; if (argc == e->args + atleast + 1) { unsigned int debug = (*what == 'C'); Index: main/pbx.c =================================================================== --- main/pbx.c (revision 211550) +++ main/pbx.c (revision 211551) @@ -2310,7 +2310,7 @@ 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 */ } } @@ -5939,7 +5939,7 @@ 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 */ @@ -6026,11 +6026,11 @@ 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; } @@ -7549,7 +7549,7 @@ 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; @@ -8664,7 +8664,7 @@ 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); Index: main/dnsmgr.c =================================================================== --- main/dnsmgr.c (revision 211550) +++ main/dnsmgr.c (revision 211551) @@ -392,7 +392,7 @@ enabled = ast_true(enabled_value); } if ((interval_value = ast_variable_retrieve(config, "general", "refreshinterval"))) { - if (sscanf(interval_value, "%d", &interval) < 1) + if (sscanf(interval_value, "%30d", &interval) < 1) ast_log(LOG_WARNING, "Unable to convert '%s' to a numeric value.\n", interval_value); else if (interval < 0) ast_log(LOG_WARNING, "Invalid refresh interval '%d' specified, using default\n", interval); Index: res/res_config_curl.c =================================================================== --- res/res_config_curl.c (revision 211550) +++ res/res_config_curl.c (revision 211551) @@ -264,7 +264,7 @@ stringp = buffer; while (*stringp <= ' ') stringp++; - sscanf(stringp, "%d", &rowcount); + sscanf(stringp, "%30d", &rowcount); ast_free(buffer); ast_free(query); @@ -327,7 +327,7 @@ stringp = buffer; while (*stringp <= ' ') stringp++; - sscanf(stringp, "%d", &rowcount); + sscanf(stringp, "%30d", &rowcount); ast_free(buffer); ast_free(query); @@ -395,7 +395,7 @@ stringp = buffer; while (*stringp <= ' ') stringp++; - sscanf(stringp, "%d", &rowcount); + sscanf(stringp, "%30d", &rowcount); ast_free(buffer); ast_free(query); Index: res/res_smdi.c =================================================================== --- res/res_smdi.c (revision 211550) +++ res/res_smdi.c (revision 211551) @@ -849,7 +849,7 @@ baud_rate = B9600; } } else if (!strcasecmp(v->name, "msdstrip")) { - if (!sscanf(v->value, "%d", &msdstrip)) { + if (!sscanf(v->value, "%30d", &msdstrip)) { ast_log(LOG_NOTICE, "Invalid msdstrip value in %s (line %d), using default\n", config_file, v->lineno); msdstrip = 0; } else if (0 > msdstrip || msdstrip > 9) { @@ -857,7 +857,7 @@ msdstrip = 0; } } else if (!strcasecmp(v->name, "msgexpirytime")) { - if (!sscanf(v->value, "%ld", &msg_expiry)) { + if (!sscanf(v->value, "%30ld", &msg_expiry)) { ast_log(LOG_NOTICE, "Invalid msgexpirytime value in %s (line %d), using default\n", config_file, v->lineno); msg_expiry = SMDI_MSG_EXPIRY_TIME; } @@ -990,7 +990,7 @@ continue; } } else if (!strcasecmp(v->name, "pollinginterval")) { - if (sscanf(v->value, "%u", &mwi_monitor.polling_interval) != 1) { + if (sscanf(v->value, "%30u", &mwi_monitor.polling_interval) != 1) { ast_log(LOG_ERROR, "Invalid value for pollinginterval: %s\n", v->value); mwi_monitor.polling_interval = DEFAULT_POLLING_INTERVAL; } @@ -1100,7 +1100,7 @@ } if (!ast_strlen_zero(args.timeout)) { - if (sscanf(args.timeout, "%u", &timeout) != 1) { + if (sscanf(args.timeout, "%30u", &timeout) != 1) { ast_log(LOG_ERROR, "'%s' is not a valid timeout\n", args.timeout); timeout = SMDI_RETRIEVE_TIMEOUT_DEFAULT; } Index: res/res_agi.c =================================================================== --- res/res_agi.c (revision 211550) +++ res/res_agi.c (revision 211551) @@ -818,7 +818,7 @@ if (argc != 4) return RESULT_SHOWUSAGE; - if (sscanf(argv[3], "%d", &to) != 1) + if (sscanf(argv[3], "%30d", &to) != 1) return RESULT_SHOWUSAGE; res = ast_waitfordigit_full(chan, to, agi->audio, agi->ctrl); ast_agi_send(agi->fd, chan, "200 result=%d\n", res); @@ -931,7 +931,7 @@ else stop = NULL; - if ((argc > 5) && (sscanf(argv[5], "%d", &skipms) != 1)) + if ((argc > 5) && (sscanf(argv[5], "%30d", &skipms) != 1)) return RESULT_SHOWUSAGE; if (argc > 6 && !ast_strlen_zero(argv[6])) @@ -969,7 +969,7 @@ if (argv[3]) edigits = argv[3]; - if ((argc > 4) && (sscanf(argv[4], "%ld", &sample_offset) != 1)) + if ((argc > 4) && (sscanf(argv[4], "%30ld", &sample_offset) != 1)) return RESULT_SHOWUSAGE; if (!(fs = ast_openstream(chan, argv[2], chan->language))) { @@ -1081,7 +1081,7 @@ if (argc < 4 || argc > 5) return RESULT_SHOWUSAGE; - if (sscanf(argv[2], "%d", &num) != 1) + if (sscanf(argv[2], "%30d", &num) != 1) return RESULT_SHOWUSAGE; res = ast_say_number_full(chan, num, argv[3], chan->language, argc > 4 ? argv[4] : NULL, agi->audio, agi->ctrl); if (res == 1) @@ -1096,7 +1096,7 @@ if (argc != 4) return RESULT_SHOWUSAGE; - if (sscanf(argv[2], "%d", &num) != 1) + if (sscanf(argv[2], "%30d", &num) != 1) return RESULT_SHOWUSAGE; res = ast_say_digit_str_full(chan, argv[2], argv[3], chan->language, agi->audio, agi->ctrl); @@ -1126,7 +1126,7 @@ if (argc != 4) return RESULT_SHOWUSAGE; - if (sscanf(argv[2], "%d", &num) != 1) + if (sscanf(argv[2], "%30d", &num) != 1) return RESULT_SHOWUSAGE; res = ast_say_date(chan, num, argv[3], chan->language); if (res == 1) @@ -1141,7 +1141,7 @@ if (argc != 4) return RESULT_SHOWUSAGE; - if (sscanf(argv[2], "%d", &num) != 1) + if (sscanf(argv[2], "%30d", &num) != 1) return RESULT_SHOWUSAGE; res = ast_say_time(chan, num, argv[3], chan->language); if (res == 1) @@ -1251,7 +1251,7 @@ if (argc != 3) return RESULT_SHOWUSAGE; - if (sscanf(argv[2], "%d", &pri) != 1) { + if (sscanf(argv[2], "%30d", &pri) != 1) { if ((pri = ast_findlabel_extension(chan, chan->context, chan->exten, argv[2], chan->cid.cid_num)) < 1) return RESULT_SHOWUSAGE; } @@ -1283,7 +1283,7 @@ if (argc < 6) return RESULT_SHOWUSAGE; - if (sscanf(argv[5], "%d", &ms) != 1) + if (sscanf(argv[5], "%30d", &ms) != 1) return RESULT_SHOWUSAGE; if (argc > 6) @@ -1324,7 +1324,7 @@ /* backward compatibility, if no offset given, arg[6] would have been * caught below and taken to be a beep, else if it is a digit then it is a * offset */ - if ((argc >6) && (sscanf(argv[6], "%ld", &sample_offset) != 1) && (!strchr(argv[6], '='))) + if ((argc >6) && (sscanf(argv[6], "%30ld", &sample_offset) != 1) && (!strchr(argv[6], '='))) res = ast_streamfile(chan, "beep", chan->language); if ((argc > 7) && (!strchr(argv[7], '='))) @@ -1444,7 +1444,7 @@ if (argc != 3) return RESULT_SHOWUSAGE; - if (sscanf(argv[2], "%d", &timeout) != 1) + if (sscanf(argv[2], "%30d", &timeout) != 1) return RESULT_SHOWUSAGE; if (timeout < 0) timeout = 0; @@ -1628,7 +1628,7 @@ return RESULT_SHOWUSAGE; if (argv[2]) - sscanf(argv[2], "%d", &level); + sscanf(argv[2], "%30d", &level); ast_verb(level, "%s: %s\n", chan->data, argv[1]); Index: res/res_config_ldap.c =================================================================== --- res/res_config_ldap.c (revision 211550) +++ res/res_config_ldap.c (revision 211551) @@ -1408,7 +1408,7 @@ if ((s = ast_variable_retrieve(config, "_general", "url"))) { ast_copy_string(url, s, sizeof(url)); } else if ((host = ast_variable_retrieve(config, "_general", "host"))) { - if (!(s = ast_variable_retrieve(config, "_general", "port")) || sscanf(s, "%d", &port) != 1) { + if (!(s = ast_variable_retrieve(config, "_general", "port")) || sscanf(s, "%5d", &port) != 1 || port > 65535) { ast_log(LOG_NOTICE, "No directory port found, using 389 as default.\n"); port = 389; } @@ -1429,7 +1429,7 @@ if (!(s = ast_variable_retrieve(config, "_general", "version")) && !(s = ast_variable_retrieve(config, "_general", "protocol"))) { ast_log(LOG_NOTICE, "No explicit LDAP version found, using 3 as default.\n"); version = 3; - } else if (sscanf(s, "%d", &version) != 1 || version < 1 || version > 6) { + } else if (sscanf(s, "%30d", &version) != 1 || version < 1 || version > 6) { ast_log(LOG_WARNING, "Invalid LDAP version '%s', using 3 as default.\n", s); version = 3; } Index: res/ael/pval.c =================================================================== --- res/ael/pval.c (revision 211550) +++ res/ael/pval.c (revision 211551) @@ -859,12 +859,12 @@ p->filename, p->startline, p->endline, p->u1.str); warns++; } - if (sscanf(times, "%d:%d", &s1, &s2) != 2) { + if (sscanf(times, "%2d:%2d", &s1, &s2) != 2) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The start time (%s) isn't quite right!\n", p->filename, p->startline, p->endline, times); warns++; } - if (sscanf(e, "%d:%d", &e1, &e2) != 2) { + if (sscanf(e, "%2d:%2d", &e1, &e2) != 2) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The end time (%s) isn't quite right!\n", p->filename, p->startline, p->endline, times); warns++; @@ -956,7 +956,7 @@ c++; } /* Find the start */ - if (sscanf(day, "%d", &s) != 1) { + if (sscanf(day, "%2d", &s) != 1) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The start day of month (%s) must be a number!\n", DAY->filename, DAY->startline, DAY->endline, day); warns++; @@ -968,7 +968,7 @@ } s--; if (c) { - if (sscanf(c, "%d", &e) != 1) { + if (sscanf(c, "%2d", &e) != 1) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The end day of month (%s) must be a number!\n", DAY->filename, DAY->startline, DAY->endline, c); warns++; Index: res/res_odbc.c =================================================================== --- res/res_odbc.c (revision 211550) +++ res/res_odbc.c (revision 211551) @@ -267,7 +267,7 @@ if (ast_false(v->value)) pooling = 1; } else if (!strcasecmp(v->name, "limit")) { - sscanf(v->value, "%d", &limit); + sscanf(v->value, "%30d", &limit); if (ast_true(v->value) && !limit) { ast_log(LOG_WARNING, "Limit should be a number, not a boolean: '%s'. Setting limit to 1023 for ODBC class '%s'.\n", v->value, cat); limit = 1023; @@ -277,7 +277,7 @@ break; } } else if (!strcasecmp(v->name, "idlecheck")) { - sscanf(v->value, "%d", &idlecheck); + sscanf(v->value, "%30u", &idlecheck); } else if (!strcasecmp(v->name, "enabled")) { enabled = ast_true(v->value); } else if (!strcasecmp(v->name, "pre-connect")) { @@ -659,7 +659,7 @@ if (ast_false(v->value)) pooling = 1; } else if (!strcasecmp(v->name, "limit")) { - sscanf(v->value, "%d", &limit); + sscanf(v->value, "%30d", &limit); if (ast_true(v->value) && !limit) { ast_log(LOG_WARNING, "Limit should be a number, not a boolean: '%s'. Setting limit to 1023 for ODBC class '%s'.\n", v->value, cat); limit = 1023; @@ -669,7 +669,7 @@ break; } } else if (!strcasecmp(v->name, "idlecheck")) { - sscanf(v->value, "%ud", &idlecheck); + sscanf(v->value, "%30u", &idlecheck); } else if (!strcasecmp(v->name, "enabled")) { enabled = ast_true(v->value); } else if (!strcasecmp(v->name, "pre-connect")) { Index: res/res_limit.c =================================================================== --- res/res_limit.c (revision 211550) +++ res/res_limit.c (revision 211551) @@ -178,7 +178,7 @@ return CLI_FAILURE; } - sscanf(a->argv[2], "%d", &x); + sscanf(a->argv[2], "%30d", &x); rlimit.rlim_max = rlimit.rlim_cur = x; setrlimit(resource, &rlimit); return CLI_SUCCESS; Index: res/snmp/agent.c =================================================================== --- res/snmp/agent.c (revision 211550) +++ res/snmp/agent.c (revision 211551) @@ -745,7 +745,7 @@ return (u_char *)version; } case ASTVERTAG: - sscanf(ast_get_version_num(), "%lu", &long_ret); + sscanf(ast_get_version_num(), "%30lu", &long_ret); return (u_char *)&long_ret; default: break; Index: res/res_musiconhold.c =================================================================== --- res/res_musiconhold.c (revision 211550) +++ res/res_musiconhold.c (revision 211551) @@ -649,7 +649,7 @@ AST_STANDARD_APP_ARGS(args, parse); if (!ast_strlen_zero(args.duration)) { - if (sscanf(args.duration, "%d", &timeout) == 1) { + if (sscanf(args.duration, "%30d", &timeout) == 1) { timeout *= 1000; } else { ast_log(LOG_WARNING, "Invalid MusicOnHold duration '%s'. Will wait indefinitely.\n", args.duration); Index: codecs/codec_speex.c =================================================================== --- codecs/codec_speex.c (revision 211550) +++ codecs/codec_speex.c (revision 211551) @@ -396,7 +396,7 @@ } else ast_log(LOG_ERROR,"Error! Complexity must be 0-10\n"); } else if (!strcasecmp(var->name, "vbr_quality")) { - if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0 && res_f <= 10) { + if (sscanf(var->value, "%30f", &res_f) == 1 && res_f >= 0 && res_f <= 10) { ast_verb(3, "CODEC SPEEX: Setting VBR Quality to %f\n",res_f); vbr_quality = res_f; } else @@ -435,7 +435,7 @@ pp_agc = ast_true(var->value) ? 1 : 0; ast_verb(3, "CODEC SPEEX: Preprocessor AGC. [%s]\n",pp_agc ? "on" : "off"); } else if (!strcasecmp(var->name, "pp_agc_level")) { - if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) { + if (sscanf(var->value, "%30f", &res_f) == 1 && res_f >= 0) { ast_verb(3, "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f); pp_agc_level = res_f; } else @@ -447,13 +447,13 @@ pp_dereverb = ast_true(var->value) ? 1 : 0; ast_verb(3, "CODEC SPEEX: Preprocessor Dereverb. [%s]\n",pp_dereverb ? "on" : "off"); } else if (!strcasecmp(var->name, "pp_dereverb_decay")) { - if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) { + if (sscanf(var->value, "%30f", &res_f) == 1 && res_f >= 0) { ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Decay to %f\n",res_f); pp_dereverb_decay = res_f; } else ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Decay must be >= 0\n"); } else if (!strcasecmp(var->name, "pp_dereverb_level")) { - if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) { + if (sscanf(var->value, "%30f", &res_f) == 1 && res_f >= 0) { ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f); pp_dereverb_level = res_f; } else Index: utils/extconf.c =================================================================== --- utils/extconf.c (revision 211550) +++ utils/extconf.c (revision 211551) @@ -3146,7 +3146,7 @@ if (!strcasecmp(s, names[i])) return i+1; } - } else if (sscanf(s, "%d", &i) == 1 && i >= 1 && i <= max) { + } else if (sscanf(s, "%30d", &i) == 1 && i >= 1 && i <= max) { return i; } return 0; /* error return */ @@ -3233,11 +3233,11 @@ 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; } @@ -5549,7 +5549,7 @@ 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 */ } } @@ -5953,7 +5953,7 @@ ipri = lastpri; else ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n"); - } else if (sscanf(pri, "%d", &ipri) != 1 && + } else if (sscanf(pri, "%30d", &ipri) != 1 && (ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) { ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno); ipri = 0; Index: utils/muted.c =================================================================== --- utils/muted.c (revision 211550) +++ utils/muted.c (revision 211551) @@ -156,7 +156,7 @@ } else if (!strcasecmp(buf, "smoothfade")) { smoothfade = 1; } else if (!strcasecmp(buf, "mutelevel")) { - if (val && (sscanf(val, "%d", &x) == 1) && (x > -1) && (x < 101)) { + if (val && (sscanf(val, "%3d", &x) == 1) && (x > -1) && (x < 101)) { mutelevel = x; } else fprintf(stderr, "mutelevel must be a number from 0 (most muted) to 100 (no mute) at line %d\n", lineno); @@ -216,7 +216,7 @@ if (ports) { *ports = '\0'; ports++; - if ((sscanf(ports, "%d", &port) != 1) || (port < 1) || (port > 65535)) { + if ((sscanf(ports, "%5d", &port) != 1) || (port < 1) || (port > 65535)) { fprintf(stderr, "'%s' is not a valid port number in the hostname\n", ports); return -1; } Index: utils/frame.c =================================================================== --- utils/frame.c (revision 211550) +++ utils/frame.c (revision 211551) @@ -355,7 +355,7 @@ double temp; char m, s, end; - k = sscanf(string, "%lf%c%c%c", &temp, &m, &s, &end); + k = sscanf(string, "%30lf%1c%1c%1c", &temp, &m, &s, &end); switch (k) { case 0: case EOF: case 4: @@ -396,7 +396,7 @@ double temp; char m, s, end; - k = sscanf(string, "%lf%c%c%c", &temp, &m, &s, &end); + k = sscanf(string, "%30lf%1c%1c%1c", &temp, &m, &s, &end); switch (k) { case 0: case EOF: case 2: case 4: @@ -476,7 +476,7 @@ if ((i = findoption( argcount, args, string)) > 0) { switch (sscanf(args[i] + 1 + strlen( string), - "%d%c", &temp, &c)) + "%30d%1c", &temp, &c)) { case 0: case EOF: case 2: argerrornum(args[i]+1, ME_NOINT); @@ -510,7 +510,7 @@ if ((i = findoption( argcount, args, string)) > 0) { - switch (sscanf(args[i] + 1 + strlen( string), "%lf%c", &temp, &end)) + switch (sscanf(args[i] + 1 + strlen( string), "%30lf%1c", &temp, &end)) { case 0: case EOF: case 2: argerrornum(args[i]+1, ME_NODOUBLE); @@ -545,7 +545,7 @@ if ((i = findoption( argcount, args, string)) > 0) { switch (sscanf(args[i] + 1 + strlen( string), - "%lf%c%c%c", &vol, &sbd, &sbb, &end)) + "%30lf%1c%1c%1c", &vol, &sbd, &sbb, &end)) { case 0: case EOF: case 4: weird = TRUE; @@ -593,7 +593,7 @@ char sbd, sbb, end; *result = 1.0; - k = sscanf(s, "%lf%c%c%c", result, &sbd, &sbb, &end); + k = sscanf(s, "%30lf%1c%1c%1c", result, &sbd, &sbb, &end); switch (k) { case 0: Index: cdr/cdr_pgsql.c =================================================================== --- cdr/cdr_pgsql.c (revision 211550) +++ cdr/cdr_pgsql.c (revision 211551) @@ -240,7 +240,7 @@ ast_cdr_getvar(cdr, cur->name, &value, buf, sizeof(buf), 0, 0); if (strncmp(cur->type, "int", 3) == 0) { long long whatever; - if (value && sscanf(value, "%lld", &whatever) == 1) { + if (value && sscanf(value, "%30lld", &whatever) == 1) { LENGTHEN_BUF2(25); lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%lld", whatever); } else { @@ -249,7 +249,7 @@ } } else if (strncmp(cur->type, "float", 5) == 0) { long double whatever; - if (value && sscanf(value, "%Lf", &whatever) == 1) { + if (value && sscanf(value, "%30Lf", &whatever) == 1) { LENGTHEN_BUF2(50); lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%30Lf", whatever); } else { @@ -508,7 +508,7 @@ ast_verb(4, "Found column '%s' of type '%s'\n", fname, ftype); cur = ast_calloc(1, sizeof(*cur) + strlen(fname) + strlen(ftype) + 2); if (cur) { - sscanf(flen, "%d", &cur->len); + sscanf(flen, "%30d", &cur->len); cur->name = (char *)cur + sizeof(*cur); cur->type = (char *)cur + sizeof(*cur) + strlen(fname) + 1; strcpy(cur->name, fname); Index: cdr/cdr_adaptive_odbc.c =================================================================== --- cdr/cdr_adaptive_odbc.c (revision 211550) +++ cdr/cdr_adaptive_odbc.c (revision 211551) @@ -419,7 +419,7 @@ case SQL_TYPE_DATE: { int year = 0, month = 0, day = 0; - if (sscanf(colptr, "%d-%d-%d", &year, &month, &day) != 3 || year <= 0 || + if (sscanf(colptr, "%4d-%2d-%2d", &year, &month, &day) != 3 || year <= 0 || month <= 0 || month > 12 || day < 0 || day > 31 || ((month == 4 || month == 6 || month == 9 || month == 11) && day == 31) || (month == 2 && year % 400 == 0 && day > 29) || @@ -441,7 +441,7 @@ case SQL_TYPE_TIME: { int hour = 0, minute = 0, second = 0; - int count = sscanf(colptr, "%d:%d:%d", &hour, &minute, &second); + int count = sscanf(colptr, "%2d:%2d:%2d", &hour, &minute, &second); if ((count != 2 && count != 3) || hour < 0 || hour > 23 || minute < 0 || minute > 59 || second < 0 || second > 59) { ast_log(LOG_WARNING, "CDR variable %s is not a valid time ('%s').\n", entry->name, colptr); @@ -457,7 +457,7 @@ case SQL_TIMESTAMP: { int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0; - int count = sscanf(colptr, "%d-%d-%d %d:%d:%d", &year, &month, &day, &hour, &minute, &second); + int count = sscanf(colptr, "%4d-%2d-%2d %2d:%2d:%2d", &year, &month, &day, &hour, &minute, &second); if ((count != 3 && count != 5 && count != 6) || year <= 0 || month <= 0 || month > 12 || day < 0 || day > 31 || @@ -482,7 +482,7 @@ case SQL_INTEGER: { int integer = 0; - if (sscanf(colptr, "%d", &integer) != 1) { + if (sscanf(colptr, "%30d", &integer) != 1) { ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name); break; } @@ -495,7 +495,7 @@ case SQL_BIGINT: { long long integer = 0; - if (sscanf(colptr, "%lld", &integer) != 1) { + if (sscanf(colptr, "%30lld", &integer) != 1) { ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name); break; } @@ -508,7 +508,7 @@ case SQL_SMALLINT: { short integer = 0; - if (sscanf(colptr, "%hd", &integer) != 1) { + if (sscanf(colptr, "%30hd", &integer) != 1) { ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name); break; } @@ -521,7 +521,7 @@ case SQL_TINYINT: { char integer = 0; - if (sscanf(colptr, "%hhd", &integer) != 1) { + if (sscanf(colptr, "%30hhd", &integer) != 1) { ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name); break; } @@ -534,7 +534,7 @@ case SQL_BIT: { char integer = 0; - if (sscanf(colptr, "%hhd", &integer) != 1) { + if (sscanf(colptr, "%30hhd", &integer) != 1) { ast_log(LOG_WARNING, "CDR variable %s is not an integer.\n", entry->name); break; } @@ -550,7 +550,7 @@ case SQL_DECIMAL: { double number = 0.0; - if (sscanf(colptr, "%lf", &number) != 1) { + if (sscanf(colptr, "%30lf", &number) != 1) { ast_log(LOG_WARNING, "CDR variable %s is not an numeric type.\n", entry->name); break; } @@ -565,7 +565,7 @@ case SQL_DOUBLE: { double number = 0.0; - if (sscanf(colptr, "%lf", &number) != 1) { + if (sscanf(colptr, "%30lf", &number) != 1) { ast_log(LOG_WARNING, "CDR variable %s is not an numeric type.\n", entry->name); break; } Property changes on: . ___________________________________________________________________ Modified: trunk-merged - /trunk:1-105595,105675,105677,105733-105734,105773,105785,105804,105840-105841,105864,105899,105933,106036,106040,106139,106186,106238-106239,106329,106346,106399,106438-106439,106501,106507,106518,106553,106607,106654,106684,106707,106789,106843,106892,106896,106946,107017,107019,107068,107100,107103,107157,107159,107162,107177,107292,107373,107406,107409,107462,107465-107466,107525,107638,107659,107710,107715,107718,107791,107827,107878,107960,107998,108032,108084,108137,108191,108238,108289,108293,108295,108346,108472,108508,108529,108531,108584,108586,108683,108738,108740,108793,108797,108799,108927,108962,109024,109108,109111,109166,109168,109227,109229,109282,109357,109389-109390,109396,109447,109451,109475,109545,109576,109651,109683,109714,109764,109775,109839,109942,109974,110020,110036,110084,110164,110268,110272,110303,110337,110339,110396,110475,110499,110578,110610,110615,110619,110629,110636,110689,110691,110726,110780,110831,110881,110911,110963,111017,111021,111025,111067,111123,111127,111130,111246,111285,111360,111410,111443,111497,111533,111565,111606,111659,111721,111857,111908-111909,111961,111998,112033,112069,112126,112148,112205,112210,112289,112357,112394,112431,112469,112600,112653-112707,112709,112711-112714,112785,112821,112972,113013,113066,113119,113172,113241,113243,113245,113297,113349,113400,113403,113455,113505,113559,113597,113647,113682,113785,113836,113838,113875,113928,113980,114022,114024,114027,114030,114036,114042,114046,114052,114061,114064,114073,114084-114085,114088,114090,114092-114093,114096,114098,114101,114104,114107,114113,114115,114118,114121,114134,114139,114141,114146,114150-114152,114185,114192,114196,114199,114202,114205,114208,114227,114233,114243,114254,114259,114271,114276,114279,114285,114300,114320,114323,114327,114389,114527,114538,114540,114548,114553,114559,114572,114575,114580,114588,114592,114595,114598,114601,114604,114609,114612,114617,114622,114625,114629,114633,114635,114651,114663,114674,114676,114690,114696,114700,114709,114713,114776,114824,114830,114849,114866,114876,114884,114888,114892,114899,114922,114931,115018,115104,115197,115277,115280,115283,115286,115288,115302,115305,115309,115313-115323,115325-115336,115338-115343,115345-115472,115474-115506,115508-115514,115516-115517,115519-115524,115526-115534,115536,115538-115581,115583,115585,115587,115589-115590,115592,115596-115736,115738-115783,115785-115812,115814-115849,115851-116137,116139-116178,116180-116221,116225-116228,116230-116236,116238,116241-116296,116298-116460,116462-116470,116472-116521,116523-116556,116558-116589,116591,116593,116595-116662,116664-116730,116732-116764,116766-116847,116849-116883,116885-117023,117025-117051,117054-117083,117085-117132,117134-117181,117183-117211,117213-117261,117263,117265,117267-117294,117296,117298-117400,117402-117430,117432-117516,117518-117523,117525-117624,117626-117657,117659-117692,117694-117724,117726-117793,117795-117801,117803-117811,117813-117821,117823-117824,117826-117827,117829-117833,117835-117869,117871-117949,117951-117982,117984-117987,117989-118058,118060-118100,118102-118156,118158,118160-118163,118165-118172,118174,118177-118222,118224-118416,118418,118420-118561,118563-118694,118696-118701,118703-118782,118784-118789,118791-118823,118825-118910,118912-119014,119016-119073,119075-119076,119078-119125,119127-119206,119208-119422,119424-119997,119999-120062,120065,120067-120128,120130-120165,120167-120173,120175-120229,120231-120371,120373-120425,120427-120634,120636-120671,120674-120731,120735-120788,120790-121041,121043-121196,121198-121283,121287-121333,121335-121364,121366,121368-121400,121404-121438,121440,121442-121495,121497-121500,121502,121504-121554,121556-121558,121560-121598,121600-121648,121650-121682,121684-121715,121717-121954,121956-121992,121994-122046,122048-122061,122063-122227,122229-122231,122233-122239,122242,122245-122314,122316-122370,122372-122398,122400-122433,122435-122460,122462-122492,122494-122522,122524-122525,122527-122615,122617-122663,122665-122715,122717-122765,122767-122801,122803-122833,122835-122922,122924-122925,122927,122929-122976,122978-123008,123010-123040,123042-123043,123045-123075,123077-123114,123116-123165,123167-123200,123202,123204-123274,123276-123357,123359-123392,123394-123445,123447,123449-123455,123457-123525,123527-123540,123542-123543,123545-123574,123576-123608,123610-123647,123649,123651-123827,123829,123831-123864,123866,123868-123987,123989-124022,124024-124048,124050-124101,124103-124124,124126,124128-124179,124181-124595,124597-124634,124636-124668,124670-124706,124708-124743,124745-124797,124799-124834,124836-124908,124910-125019,125021-125054,125056-125095,125097-125132,125134,125136-125331,125333-125385,125387-125437,125439-125592,125594-125595,125597-125646,125648-125795,125797-125855,125857-125879,125881-125893,125896-126020,126022-126114,126116-126151,126155-126186,126188-126307,126313-126318,126320-126395,126397-126447,126449-126479,126481-126514,126516-126570,126573-126680,126682-126834,126836-126958,126961-126990,126992-127016,127018-127088,127090-127168,127170-127209,127211-127329,127331-127361,127363-127400,127402-127501,127503-127544,127546-127557,127559-127563,127565-127608,127610-127621,127623-127684,127686-127719,127721-127830,127832-127851,127853-127855,127858-127930,127932,127935-127994,127996-128029,128031-128081,128083-128196,128199-128200,128202-128239,128241,128243-128246,128248-128253,128255-128273,128275-128283,128285-128293,128295-128343,128345-128377,128380,128382-128453,128456-128484,128486-128524,128526-128563,128565-128637,128639-128689,128691-129113,129115-129158,129160-129209,129211-129306,129308-129505,129507-129580,129582-129733,129735-129984,129986,129988-130042,130044-130231,130233,130235-130295,130298-130319,130321-130373,130375-130575,130577-130696,130698-130731,130734-130950,130952-131014,131016-131206,131208-131481,131483-131528,131530-131569,131571-131605,131607-131642,131644-132045,132047-132168,132170-132202,132204-132205,132207-132469,132471-132571,132573-132785,132787,132789-132826,132828-132974,132976-133237,133239-133565,133567-133569,133571-133650,133652-133709,133711-133769,133771-133818,133820-133859,133861-133903,133905-133940,133942,133944-134004,134006-134087,134089-134161,134163-134252,134254-134311,134313-134352,134354-134400,134402-134441,134444-134652,134654-134704,134706-134802,134804-134814,134816-134866,134868-134915,134917-134918,134920-134924,134926-135060,135062-135157,135159-135234,135236-135299,135301,135303-135331,135333-135370,135372,135374-135404,135406-135475,135477-135647,135649-135679,135682-135716,135718-136033,136035-136140,136142-136244,136246-136297,136299,136301,136303-136304,136306-136348,136350-136401,136403-136404,136407,136409-136476,136478-136480,136482-136503,136505-136561,136563-136675,136677-136678,136680-136719,136721-136750,136752-136786,136788-136818,136820-136887,136889,136891-136916,136918-137027,137029-137054,137056-137081,137083-137088,137090-137109,137111,137113-137348,137350-137455,137457-137530,137532-137581,137583-137677,137679-137850,137852-137900,137902-138085,138087-138123,138125-138147,138149-138154,138156-138309,138311-138408,138410-138516,138518-138569,138571-138693,138695-138737,138739-138813,138815-138850,138852-138886,138888-138938,138940-138942,138944-138950,138952-139019,139021-139145,139147-139152,139155-139209,139211-139344,139347-139524,139526-139557,139559-139562,139564-139621,139623-139703,139705-139770,139772-139774,139776-139831,139833-139927,139929-139980,139982-140051,140054-140056,140058-140060,140062-140115,140117-140166,140168-140200,140202-140245,140247-140300,140302-140354,140356-140417,140419-140421,140423-140432,140434-140488,140490,140492-140558,140560-140562,140564-140751,140753-140819,140822-140823,140825-140859,140861-140886,140888-140937,140939-141217,141219-141270,141272-141327,141329-141424,141426-141463,141465-141506,141508-141625,141627-141678,141680-141905,141907-141997,141999,142001-142079,142081-142145,142147-142180,142182-142218,142220-142317,142319-142535,142537-142634,142636-142807,142809-142991,142993-143033,143035-143225,143227-143270,143272-143339,143341-143399,143401-143475,143477-143696,143698-143798,143800-143839,143841-143973,143975-144148,144150-144198,144200-144257,144482,144523,144563,144569,144635,144678,144681,144829,144949-144951,145076,145249,145428,145487,145553,145579,145606,145692,145962,146198,146514,146555,146807,146920,146928,147050,147194,147518-147591,147593-147634,147636-147713,147715-147759,147762-147852,147855-147941,147943-147951,147953-148009,148011-148068,148072-148159,148161-148324,148326-148328,148330-148375,148377-148424,148426-148470,148472,148475-148518,148520-148569,148571-148678,148680-148694,148696-148736,148738-148753,148755-148824,148826-148866,148868-148984,148986-148990,148992-149039,149041-149198,149200-149208,149487,149756,150125,150307,150817,150906-150929,150931-150970,150972-151018,151020-151059,151061-151100,151102-151187,151189,151191-151245,151247-151326,151328-151370,151372-151419,151421-151427,151429-151438,151440-151511,151513-151553,151556-151599,151602-151641,151643-151681,151683-151721,151723-151731,151733-151738,151740-151760,151763,151765-151829,151831-151905,151907-151979,151981-152018,152021-152131,152133-152173,152175-152447,152449-152535,152537-152605,152646,152765,152812,152969-152989,152991-153056,153058-153123,153125-153222,153224-153295,153297-153361,153363-153364,153366-153402,153404-153434,153436,153438-153467,153469,153471,153473-153506,153508-153540,153542,153544-153576,153579,153581,153583-153616,153619-153651,153653-153746,153748-153786,153788-153802,153804-153851,153853-153903,153906-153946,153948-153982,153984-154022,154024-154148,154150,154152-154185,154188-154190,154192-154224,154226-154259,154261-154328,154330-154427,154430-154466,154468,154470-154506,154508-154541,154543-154577,154579-154614,154616,154618-154646,154648-154686,154688-154731,154733-154795,154797,154799-154800,154802-154836,154838,154840-154874,154876-154914,154916-154921,154924-154925,154927-154966,154968-155065,155067-155078,155081-155174,155176-155203,155205,155207-155240,155242-155243,155245-155263,155265-155281,155283,155285-155323,155325-155394,155396-155400,155402-155512,155514-155515,155517-155589,155591-155636,155638-155670,155672-155710,155712-155762,155764-155928,155930-155933,155935-155966,155968-156017,156019-156050,156052-156086,156088-156119,156121-156124,156126,156128-156161,156163-156297,156299-156354,156356-156442,156444-156534,156536-156540,156542-156574,156576-156611,156613-156646,156648,156650-156873,156875-156882,156884-156915,156917,156919-156961,156963-157005,157007-157038,157040,157042-157072,157074-157166,157168-157252,157254-157365,157367-157459,157462,157464-157511,157513-157561,157563,157565-157591,157593-157631,157633-157638,157640-157674,157676-157738,157740-157783,157785-157817,157819,157821-157869,157871-157873,157875-157892,157894-157905,157907-157938,157941-157972,157975-158060,158063-158069,158071,158073-158077,158079-158132,158134-158306,158308-158314,158316-158413,158415-158481,158483-158604,158607-158631,158633-158685,158687,158689,158691-158693,158695-158722,158724-158753,158755,158757-158807,158809-158850,158852-158856,158858-158875,158877-158923,158926-158958,158960-159049,159051-159053,159055-159158,159160-159161,159163-159188,159190-159249,159251-159276,159360,159475,159534,159554,159774,159818,159898,159911,160004,160097,160170-160172,160208,160308,160319,160333,160481,160552,160555,160559,160585,160626,160663,160699-160700,160760,160791,160854,160856,160945,161014,161147,161181,161252,161288,161349-161350,161427,161493,161726,161790,161951,162016,162079,162140,162197,162205,162266,162271,162275,162291,162342,162355,162414,162466,162488,162583,162619,162656,162664,162667,162739,162805,162891,162927,163081,163085,163089,163094,163168,163171,163254,163317,163384,163449,163512,163612,163642,163667,163670,163675,163762,163873,164203,164257,164268,164270,164272,164349,164351,164419,164423,164602,164606,164623,164648,164659,164675,164737,164798,164801,164807,164877,164882,164942,164978,165071,165142-165143,165180-165318,165320-165324,165327-165329,165331-165396,165398-165432,165434-165468,165470-165501,165503-165537,165539-165540,165542-165723,165725-165791,165793-165797,165799-165882,165884-165885,165887-165953,165955-165991,165993-166057,166059-166157,166159-166218,166220-166262,166264-166267,166269-166341,166343-166600,166602-166624,166626-166730,166732-166822,166824-166957,166959-167020,167022-167056,167058-167060,167062-167124,167126-167179,167181-167415,167417-167790,167793-167834,167836,167838-167887,167889-167972,167974-168053,168055-168264,168266-168268,168270-168478,168480-168521,168524-168538,168540-168574,168576-168578,168580-168584,168586-168590,168592-168598,168600,168602-168608,168611-168618,168620-168625,168627-168635,168637,168640-168718,168720-168724,168726-168727,168729-168731,168733,168735-168758,168761-168897,168899-169079,169081-169115,169117-169152,169154-169276,169278-169324,169326,169328-169366,169368,169370-169437,169439-169556,169558-169573,169575-169613,169615-169619,169621-169624,169626-169672,169674-169790,169792-169797,169799-169865,169867-169909,169911-170006,170008-170111,170113-170306,170308-170350,170352-170456,170458-170459,170461-170462,170464-170497,170499-170901,170903-171042,171044-171080,171082-171120,171122,171124-171262,171264-171363,171365-171399,171402-171452,171454-171557,171559-171756,171758-171792,171794-171796,171798-171879,171881-171923,171926-172098,172100-172130,172133-172233,172235-172267,172269,172271-172317,172320-172369,172371-172439,172441-172547,172549-172639,172641-172777,172779-172815,172819-172854,172856-172889,172891-172928,172930-172962,172964-173027,173029-173046,173048-173129,173131-173168,173170-173248,173250-173501,173504-173656,173658-173770,173772-173847,173849-173857,173859-173900,173903-174045,174047-174324,174326-174369,174371-174431,174433-174434,174436-174469,174471-174502,174504-174579,174581-174644,174646-174704,174706-174843,174845-174885,174887-174950,174952-175126,175128-175249,175251-175343,175345-175407,175409-175410,175412-175474,175476-175507,175509-175511,175513-175590,175592-175596,175598-175622,175624-175635,175637-175654,175656-175662,175664-175698,175700-175782,175784-175828,175830-175881,175883-175982,175984-176099,176101-176137,176139-176319,176321-176355,176357-176359,176361-176500,176502-176512,176514-176555,176558-176591,176593-176626,176628-176630,176633-176634,176636-176638,176640-176665,176667-176668,176670-176705,176707-176770,176772-176840,176842-176868,176870-176900,176902-176903,176905-177160,177162-177286,177288-177290,177292-177319,177321-177450,177452-177505,177507-177623,177625-177696,177698-177731,177733-177848,177850-177851,177853-177854,177856-177883,177885-177912,177914-177943,177945-177987,177989-178021,178023-178026,178028-178029,178031-178060,178062-178106,178108-178299,178301-178572,178574-178604,178606,178608-178640,178642-178702,178705-178732,178734-178763,178765-178800,178802-178847,178849-178869,178871-178918,178920-179020,179022-179121,179123-179153,179155-179163,179165-179253,179255-179290,179292-179322,179324-179360,179362-179464,179466-179674,179676-179744,179746-179902,179904-179936,179938-179971,179973-180010,180012-180078,180080-180154,180156-180258,180260,180262-180303,180305-180333,180335-180368,180370-180381,180383-180640,180642-180683,180685-180718,180720-180749,180751-180858,180860-180861,180863-180897,180899-180934,180936-180937,180939-180941,180943-181026,181029-181098,181100-181133,181135-181209,181211-181243,181245-181291,181293-181300,181302-181464,181466-181576,181578-181898,181900-181984,181986-182021,182023-182070,182072-182354,182356-182361,182363-182407,182409-182520,182522-182595,182597-182606,182608-182652,182654-182761,182763-182825,182827-182847,182849-182882,182884-182959,182961-182963,182965,182967-183031,183033-183123,183125-183147,183149-183195,183197-183238,183240-183311,183313-183344,183346-183510,183512-183552,183556-183651,183653-183830,183832-183994,183996-184042,184044-184150,184152-184218,184220-184338,184340-184343,184345-184511,184513-184530,184532-184627,184629,184631-184638,184640-184676,184678-184692,184694-184761,184763-184797,184799-184800,184802-184985,184987-185298,185300-185431,185433-185531,185533-185580,185582-185603,185605-185703,185705-185740,185742-185776,185778-185911,185913-186020,186022-186057,186059-186077,186079-186296,186298-186381,186383-186446,186448-186524,186526-186536,186538-186562,186564-186565,186567-186619,186621-186623,186625-186652,186654-186686,186688-186898,186900-186927,186929-186952,186954-186956,186958-187035,187037-187049,187051-187104,187106-187107,187109-187137,187139-187178,187180-187209,187212-187268,187270-187359,187362-187380,187382-187425,187427-187487,187489-187490,187492-187555,187557-187559,187561-187598,187600-187633,187637-187672,187676-187679,187681-187713,187715-187769,187771,187774-187829,187831-187865,187867-187962,187964-188149,188151-188282,188285-188341,188343-188377,188379-188514,188516-188543,188545-188704,188706-188741,188743-188900,188902-188941,188943-189349,189351-189537,189540-189734,189736-189991,189993-189999,190001-190153,190155-190216,190218-190249,190251-190348,190350-190420,190422,190424-190453,190455-190456,190458-190483,190485-190515,190518-190544,190546-190576,190578-190585,190587-190625,190627-190662,190664-190734,190736-190796,190798-190829,190831-190864,190866-190946,190948-190988,190990,190992,190994-191027,191029-191115,191117-191139,191141-191174,191176,191178-191210,191212,191214-191220,191222-191299,191301-191331,191333-191410,191412-191417,191420-191422,191424-191629,191631-191738,191740-191780,191782-191784,191786-191847,191849-191883,191885-191918,191920-191996,191998-192031,192033-192058,192060-192095,192097-192170,192172-192361,192363-192426,192428-192589,192591-192699,192701-192735,192737-192771,192773-192807,192809-192852,192854-193005,193007-193348,193350-193458,193460,193462-193501,193503-193677,193679-193717,193719-193756,193758-193831,193833-193885,193887-194059,194061-194100,194102-194282,194284-194429,194431-194476,194478,194480-194609,194611-194634,194636-194648,194650-194944,194946-194981,194983-195074,195076-195164,195166-195209,195211-195265,195267-195278,195280-195364,195366,195369-195588,195590-195762,195764-195797,195799-195948,195950-195991,195993-196071,196073-196113,196115-196186,196189-196226,196228-196245,196247-196267,196269,196271,196273-196307,196309-196343,196345-196376,196378-196380,196382-196416,196418-196455,196457-196487,196489-196519,196521-196553,196555-196584,196586-196621,196623-196724,196726-196757,196759-196791,196793-196892,196894-196906,196908-196944,196947,196949-197024,197026-197124,197126-197188,197190-197264,197267-197334,197336-197337,197339-197373,197375-197405,197407-197408,197410-197430,197432-197527,197529-197534,197536-197569,197571-197615,197617-197700,197702-197737,197739,197741-197774,197776,197778-197823,197825-197827,197829-197860,197862-197925,197927-197958,197961-197995,197997-198063,198065-198082,198084-198087,198089-198138,198140-198145,198147-198181,198184-198185,198187-198216,198218-198247,198249-198433,198435-198436,198439-198441,198443-198469,198471-198497,198499,198501-198510,198512-198528,198531-198557,198559-198560,198562-198564,198566-198596,198598-198660,198662-198665,198667-198669,198671-198724,198726,198728,198730-198761,198763-198891,198893-198953,198955-198957,198959-199090,199092-199367,199369,199371,199373,199375,199377-199408,199410,199412,199414-199445,199447-199478,199480-199513,199515-199546,199548-199587,199589-199695,199697-199742,199744-199922,199924-199957,199959-199999,200001-200037,200039-200107,200109-200189,200191-200253,200255-200289,200291-200325,200327-200427,200429,200431-200476,200478-200518,200520-200583,200585-200586,200588-200619,200621-200655,200657-200689,200726,200764,200943,200946,200985,201056-201090,201223,201262,201381,201445,201458,201462,201610,201678,201783,201829,201994,202183,202258,202262,202337,202343,202415,202417,202497,202574,202603,202672,202753,202761,202925,202967,203037,203116,203231,203376,203381,203444,203672,203699,203710,203721,203779,203802,203853,203909,204247,204301,204470,204475,204563,204710,204835,204948,205120,205151,205196,205216,205291,205350,205412,205479,205532,205600,205696,205770,205776,205840,205878,205939,205985,206341,206386,206489,206567,206636,206702,206707,206768,206808,206868,206873,206939,207029,207095,207156,207361,207424,207680,207723,207854,207946,208263,208314,208383,208388,208464,208548,208588,208593,208749,208924,209056,209098,209132,209256,209279,209317,209554,209711,209760-209761,209839,209887,210238,210564,210640,210817,210908,210914,210992,211040,211113,211232,211275,211347 + /trunk:1-105595,105675,105677,105733-105734,105773,105785,105804,105840-105841,105864,105899,105933,106036,106040,106139,106186,106238-106239,106329,106346,106399,106438-106439,106501,106507,106518,106553,106607,106654,106684,106707,106789,106843,106892,106896,106946,107017,107019,107068,107100,107103,107157,107159,107162,107177,107292,107373,107406,107409,107462,107465-107466,107525,107638,107659,107710,107715,107718,107791,107827,107878,107960,107998,108032,108084,108137,108191,108238,108289,108293,108295,108346,108472,108508,108529,108531,108584,108586,108683,108738,108740,108793,108797,108799,108927,108962,109024,109108,109111,109166,109168,109227,109229,109282,109357,109389-109390,109396,109447,109451,109475,109545,109576,109651,109683,109714,109764,109775,109839,109942,109974,110020,110036,110084,110164,110268,110272,110303,110337,110339,110396,110475,110499,110578,110610,110615,110619,110629,110636,110689,110691,110726,110780,110831,110881,110911,110963,111017,111021,111025,111067,111123,111127,111130,111246,111285,111360,111410,111443,111497,111533,111565,111606,111659,111721,111857,111908-111909,111961,111998,112033,112069,112126,112148,112205,112210,112289,112357,112394,112431,112469,112600,112653-112707,112709,112711-112714,112785,112821,112972,113013,113066,113119,113172,113241,113243,113245,113297,113349,113400,113403,113455,113505,113559,113597,113647,113682,113785,113836,113838,113875,113928,113980,114022,114024,114027,114030,114036,114042,114046,114052,114061,114064,114073,114084-114085,114088,114090,114092-114093,114096,114098,114101,114104,114107,114113,114115,114118,114121,114134,114139,114141,114146,114150-114152,114185,114192,114196,114199,114202,114205,114208,114227,114233,114243,114254,114259,114271,114276,114279,114285,114300,114320,114323,114327,114389,114527,114538,114540,114548,114553,114559,114572,114575,114580,114588,114592,114595,114598,114601,114604,114609,114612,114617,114622,114625,114629,114633,114635,114651,114663,114674,114676,114690,114696,114700,114709,114713,114776,114824,114830,114849,114866,114876,114884,114888,114892,114899,114922,114931,115018,115104,115197,115277,115280,115283,115286,115288,115302,115305,115309,115313-115323,115325-115336,115338-115343,115345-115472,115474-115506,115508-115514,115516-115517,115519-115524,115526-115534,115536,115538-115581,115583,115585,115587,115589-115590,115592,115596-115736,115738-115783,115785-115812,115814-115849,115851-116137,116139-116178,116180-116221,116225-116228,116230-116236,116238,116241-116296,116298-116460,116462-116470,116472-116521,116523-116556,116558-116589,116591,116593,116595-116662,116664-116730,116732-116764,116766-116847,116849-116883,116885-117023,117025-117051,117054-117083,117085-117132,117134-117181,117183-117211,117213-117261,117263,117265,117267-117294,117296,117298-117400,117402-117430,117432-117516,117518-117523,117525-117624,117626-117657,117659-117692,117694-117724,117726-117793,117795-117801,117803-117811,117813-117821,117823-117824,117826-117827,117829-117833,117835-117869,117871-117949,117951-117982,117984-117987,117989-118058,118060-118100,118102-118156,118158,118160-118163,118165-118172,118174,118177-118222,118224-118416,118418,118420-118561,118563-118694,118696-118701,118703-118782,118784-118789,118791-118823,118825-118910,118912-119014,119016-119073,119075-119076,119078-119125,119127-119206,119208-119422,119424-119997,119999-120062,120065,120067-120128,120130-120165,120167-120173,120175-120229,120231-120371,120373-120425,120427-120634,120636-120671,120674-120731,120735-120788,120790-121041,121043-121196,121198-121283,121287-121333,121335-121364,121366,121368-121400,121404-121438,121440,121442-121495,121497-121500,121502,121504-121554,121556-121558,121560-121598,121600-121648,121650-121682,121684-121715,121717-121954,121956-121992,121994-122046,122048-122061,122063-122227,122229-122231,122233-122239,122242,122245-122314,122316-122370,122372-122398,122400-122433,122435-122460,122462-122492,122494-122522,122524-122525,122527-122615,122617-122663,122665-122715,122717-122765,122767-122801,122803-122833,122835-122922,122924-122925,122927,122929-122976,122978-123008,123010-123040,123042-123043,123045-123075,123077-123114,123116-123165,123167-123200,123202,123204-123274,123276-123357,123359-123392,123394-123445,123447,123449-123455,123457-123525,123527-123540,123542-123543,123545-123574,123576-123608,123610-123647,123649,123651-123827,123829,123831-123864,123866,123868-123987,123989-124022,124024-124048,124050-124101,124103-124124,124126,124128-124179,124181-124595,124597-124634,124636-124668,124670-124706,124708-124743,124745-124797,124799-124834,124836-124908,124910-125019,125021-125054,125056-125095,125097-125132,125134,125136-125331,125333-125385,125387-125437,125439-125592,125594-125595,125597-125646,125648-125795,125797-125855,125857-125879,125881-125893,125896-126020,126022-126114,126116-126151,126155-126186,126188-126307,126313-126318,126320-126395,126397-126447,126449-126479,126481-126514,126516-126570,126573-126680,126682-126834,126836-126958,126961-126990,126992-127016,127018-127088,127090-127168,127170-127209,127211-127329,127331-127361,127363-127400,127402-127501,127503-127544,127546-127557,127559-127563,127565-127608,127610-127621,127623-127684,127686-127719,127721-127830,127832-127851,127853-127855,127858-127930,127932,127935-127994,127996-128029,128031-128081,128083-128196,128199-128200,128202-128239,128241,128243-128246,128248-128253,128255-128273,128275-128283,128285-128293,128295-128343,128345-128377,128380,128382-128453,128456-128484,128486-128524,128526-128563,128565-128637,128639-128689,128691-129113,129115-129158,129160-129209,129211-129306,129308-129505,129507-129580,129582-129733,129735-129984,129986,129988-130042,130044-130231,130233,130235-130295,130298-130319,130321-130373,130375-130575,130577-130696,130698-130731,130734-130950,130952-131014,131016-131206,131208-131481,131483-131528,131530-131569,131571-131605,131607-131642,131644-132045,132047-132168,132170-132202,132204-132205,132207-132469,132471-132571,132573-132785,132787,132789-132826,132828-132974,132976-133237,133239-133565,133567-133569,133571-133650,133652-133709,133711-133769,133771-133818,133820-133859,133861-133903,133905-133940,133942,133944-134004,134006-134087,134089-134161,134163-134252,134254-134311,134313-134352,134354-134400,134402-134441,134444-134652,134654-134704,134706-134802,134804-134814,134816-134866,134868-134915,134917-134918,134920-134924,134926-135060,135062-135157,135159-135234,135236-135299,135301,135303-135331,135333-135370,135372,135374-135404,135406-135475,135477-135647,135649-135679,135682-135716,135718-136033,136035-136140,136142-136244,136246-136297,136299,136301,136303-136304,136306-136348,136350-136401,136403-136404,136407,136409-136476,136478-136480,136482-136503,136505-136561,136563-136675,136677-136678,136680-136719,136721-136750,136752-136786,136788-136818,136820-136887,136889,136891-136916,136918-137027,137029-137054,137056-137081,137083-137088,137090-137109,137111,137113-137348,137350-137455,137457-137530,137532-137581,137583-137677,137679-137850,137852-137900,137902-138085,138087-138123,138125-138147,138149-138154,138156-138309,138311-138408,138410-138516,138518-138569,138571-138693,138695-138737,138739-138813,138815-138850,138852-138886,138888-138938,138940-138942,138944-138950,138952-139019,139021-139145,139147-139152,139155-139209,139211-139344,139347-139524,139526-139557,139559-139562,139564-139621,139623-139703,139705-139770,139772-139774,139776-139831,139833-139927,139929-139980,139982-140051,140054-140056,140058-140060,140062-140115,140117-140166,140168-140200,140202-140245,140247-140300,140302-140354,140356-140417,140419-140421,140423-140432,140434-140488,140490,140492-140558,140560-140562,140564-140751,140753-140819,140822-140823,140825-140859,140861-140886,140888-140937,140939-141217,141219-141270,141272-141327,141329-141424,141426-141463,141465-141506,141508-141625,141627-141678,141680-141905,141907-141997,141999,142001-142079,142081-142145,142147-142180,142182-142218,142220-142317,142319-142535,142537-142634,142636-142807,142809-142991,142993-143033,143035-143225,143227-143270,143272-143339,143341-143399,143401-143475,143477-143696,143698-143798,143800-143839,143841-143973,143975-144148,144150-144198,144200-144257,144482,144523,144563,144569,144635,144678,144681,144829,144949-144951,145076,145249,145428,145487,145553,145579,145606,145692,145962,146198,146514,146555,146807,146920,146928,147050,147194,147518-147591,147593-147634,147636-147713,147715-147759,147762-147852,147855-147941,147943-147951,147953-148009,148011-148068,148072-148159,148161-148324,148326-148328,148330-148375,148377-148424,148426-148470,148472,148475-148518,148520-148569,148571-148678,148680-148694,148696-148736,148738-148753,148755-148824,148826-148866,148868-148984,148986-148990,148992-149039,149041-149198,149200-149208,149487,149756,150125,150307,150817,150906-150929,150931-150970,150972-151018,151020-151059,151061-151100,151102-151187,151189,151191-151245,151247-151326,151328-151370,151372-151419,151421-151427,151429-151438,151440-151511,151513-151553,151556-151599,151602-151641,151643-151681,151683-151721,151723-151731,151733-151738,151740-151760,151763,151765-151829,151831-151905,151907-151979,151981-152018,152021-152131,152133-152173,152175-152447,152449-152535,152537-152605,152646,152765,152812,152969-152989,152991-153056,153058-153123,153125-153222,153224-153295,153297-153361,153363-153364,153366-153402,153404-153434,153436,153438-153467,153469,153471,153473-153506,153508-153540,153542,153544-153576,153579,153581,153583-153616,153619-153651,153653-153746,153748-153786,153788-153802,153804-153851,153853-153903,153906-153946,153948-153982,153984-154022,154024-154148,154150,154152-154185,154188-154190,154192-154224,154226-154259,154261-154328,154330-154427,154430-154466,154468,154470-154506,154508-154541,154543-154577,154579-154614,154616,154618-154646,154648-154686,154688-154731,154733-154795,154797,154799-154800,154802-154836,154838,154840-154874,154876-154914,154916-154921,154924-154925,154927-154966,154968-155065,155067-155078,155081-155174,155176-155203,155205,155207-155240,155242-155243,155245-155263,155265-155281,155283,155285-155323,155325-155394,155396-155400,155402-155512,155514-155515,155517-155589,155591-155636,155638-155670,155672-155710,155712-155762,155764-155928,155930-155933,155935-155966,155968-156017,156019-156050,156052-156086,156088-156119,156121-156124,156126,156128-156161,156163-156297,156299-156354,156356-156442,156444-156534,156536-156540,156542-156574,156576-156611,156613-156646,156648,156650-156873,156875-156882,156884-156915,156917,156919-156961,156963-157005,157007-157038,157040,157042-157072,157074-157166,157168-157252,157254-157365,157367-157459,157462,157464-157511,157513-157561,157563,157565-157591,157593-157631,157633-157638,157640-157674,157676-157738,157740-157783,157785-157817,157819,157821-157869,157871-157873,157875-157892,157894-157905,157907-157938,157941-157972,157975-158060,158063-158069,158071,158073-158077,158079-158132,158134-158306,158308-158314,158316-158413,158415-158481,158483-158604,158607-158631,158633-158685,158687,158689,158691-158693,158695-158722,158724-158753,158755,158757-158807,158809-158850,158852-158856,158858-158875,158877-158923,158926-158958,158960-159049,159051-159053,159055-159158,159160-159161,159163-159188,159190-159249,159251-159276,159360,159475,159534,159554,159774,159818,159898,159911,160004,160097,160170-160172,160208,160308,160319,160333,160481,160552,160555,160559,160585,160626,160663,160699-160700,160760,160791,160854,160856,160945,161014,161147,161181,161252,161288,161349-161350,161427,161493,161726,161790,161951,162016,162079,162140,162197,162205,162266,162271,162275,162291,162342,162355,162414,162466,162488,162583,162619,162656,162664,162667,162739,162805,162891,162927,163081,163085,163089,163094,163168,163171,163254,163317,163384,163449,163512,163612,163642,163667,163670,163675,163762,163873,164203,164257,164268,164270,164272,164349,164351,164419,164423,164602,164606,164623,164648,164659,164675,164737,164798,164801,164807,164877,164882,164942,164978,165071,165142-165143,165180-165318,165320-165324,165327-165329,165331-165396,165398-165432,165434-165468,165470-165501,165503-165537,165539-165540,165542-165723,165725-165791,165793-165797,165799-165882,165884-165885,165887-165953,165955-165991,165993-166057,166059-166157,166159-166218,166220-166262,166264-166267,166269-166341,166343-166600,166602-166624,166626-166730,166732-166822,166824-166957,166959-167020,167022-167056,167058-167060,167062-167124,167126-167179,167181-167415,167417-167790,167793-167834,167836,167838-167887,167889-167972,167974-168053,168055-168264,168266-168268,168270-168478,168480-168521,168524-168538,168540-168574,168576-168578,168580-168584,168586-168590,168592-168598,168600,168602-168608,168611-168618,168620-168625,168627-168635,168637,168640-168718,168720-168724,168726-168727,168729-168731,168733,168735-168758,168761-168897,168899-169079,169081-169115,169117-169152,169154-169276,169278-169324,169326,169328-169366,169368,169370-169437,169439-169556,169558-169573,169575-169613,169615-169619,169621-169624,169626-169672,169674-169790,169792-169797,169799-169865,169867-169909,169911-170006,170008-170111,170113-170306,170308-170350,170352-170456,170458-170459,170461-170462,170464-170497,170499-170901,170903-171042,171044-171080,171082-171120,171122,171124-171262,171264-171363,171365-171399,171402-171452,171454-171557,171559-171756,171758-171792,171794-171796,171798-171879,171881-171923,171926-172098,172100-172130,172133-172233,172235-172267,172269,172271-172317,172320-172369,172371-172439,172441-172547,172549-172639,172641-172777,172779-172815,172819-172854,172856-172889,172891-172928,172930-172962,172964-173027,173029-173046,173048-173129,173131-173168,173170-173248,173250-173501,173504-173656,173658-173770,173772-173847,173849-173857,173859-173900,173903-174045,174047-174324,174326-174369,174371-174431,174433-174434,174436-174469,174471-174502,174504-174579,174581-174644,174646-174704,174706-174843,174845-174885,174887-174950,174952-175126,175128-175249,175251-175343,175345-175407,175409-175410,175412-175474,175476-175507,175509-175511,175513-175590,175592-175596,175598-175622,175624-175635,175637-175654,175656-175662,175664-175698,175700-175782,175784-175828,175830-175881,175883-175982,175984-176099,176101-176137,176139-176319,176321-176355,176357-176359,176361-176500,176502-176512,176514-176555,176558-176591,176593-176626,176628-176630,176633-176634,176636-176638,176640-176665,176667-176668,176670-176705,176707-176770,176772-176840,176842-176868,176870-176900,176902-176903,176905-177160,177162-177286,177288-177290,177292-177319,177321-177450,177452-177505,177507-177623,177625-177696,177698-177731,177733-177848,177850-177851,177853-177854,177856-177883,177885-177912,177914-177943,177945-177987,177989-178021,178023-178026,178028-178029,178031-178060,178062-178106,178108-178299,178301-178572,178574-178604,178606,178608-178640,178642-178702,178705-178732,178734-178763,178765-178800,178802-178847,178849-178869,178871-178918,178920-179020,179022-179121,179123-179153,179155-179163,179165-179253,179255-179290,179292-179322,179324-179360,179362-179464,179466-179674,179676-179744,179746-179902,179904-179936,179938-179971,179973-180010,180012-180078,180080-180154,180156-180258,180260,180262-180303,180305-180333,180335-180368,180370-180381,180383-180640,180642-180683,180685-180718,180720-180749,180751-180858,180860-180861,180863-180897,180899-180934,180936-180937,180939-180941,180943-181026,181029-181098,181100-181133,181135-181209,181211-181243,181245-181291,181293-181300,181302-181464,181466-181576,181578-181898,181900-181984,181986-182021,182023-182070,182072-182354,182356-182361,182363-182407,182409-182520,182522-182595,182597-182606,182608-182652,182654-182761,182763-182825,182827-182847,182849-182882,182884-182959,182961-182963,182965,182967-183031,183033-183123,183125-183147,183149-183195,183197-183238,183240-183311,183313-183344,183346-183510,183512-183552,183556-183651,183653-183830,183832-183994,183996-184042,184044-184150,184152-184218,184220-184338,184340-184343,184345-184511,184513-184530,184532-184627,184629,184631-184638,184640-184676,184678-184692,184694-184761,184763-184797,184799-184800,184802-184985,184987-185298,185300-185431,185433-185531,185533-185580,185582-185603,185605-185703,185705-185740,185742-185776,185778-185911,185913-186020,186022-186057,186059-186077,186079-186296,186298-186381,186383-186446,186448-186524,186526-186536,186538-186562,186564-186565,186567-186619,186621-186623,186625-186652,186654-186686,186688-186898,186900-186927,186929-186952,186954-186956,186958-187035,187037-187049,187051-187104,187106-187107,187109-187137,187139-187178,187180-187209,187212-187268,187270-187359,187362-187380,187382-187425,187427-187487,187489-187490,187492-187555,187557-187559,187561-187598,187600-187633,187637-187672,187676-187679,187681-187713,187715-187769,187771,187774-187829,187831-187865,187867-187962,187964-188149,188151-188282,188285-188341,188343-188377,188379-188514,188516-188543,188545-188704,188706-188741,188743-188900,188902-188941,188943-189349,189351-189537,189540-189734,189736-189991,189993-189999,190001-190153,190155-190216,190218-190249,190251-190348,190350-190420,190422,190424-190453,190455-190456,190458-190483,190485-190515,190518-190544,190546-190576,190578-190585,190587-190625,190627-190662,190664-190734,190736-190796,190798-190829,190831-190864,190866-190946,190948-190988,190990,190992,190994-191027,191029-191115,191117-191139,191141-191174,191176,191178-191210,191212,191214-191220,191222-191299,191301-191331,191333-191410,191412-191417,191420-191422,191424-191629,191631-191738,191740-191780,191782-191784,191786-191847,191849-191883,191885-191918,191920-191996,191998-192031,192033-192058,192060-192095,192097-192170,192172-192361,192363-192426,192428-192589,192591-192699,192701-192735,192737-192771,192773-192807,192809-192852,192854-193005,193007-193348,193350-193458,193460,193462-193501,193503-193677,193679-193717,193719-193756,193758-193831,193833-193885,193887-194059,194061-194100,194102-194282,194284-194429,194431-194476,194478,194480-194609,194611-194634,194636-194648,194650-194944,194946-194981,194983-195074,195076-195164,195166-195209,195211-195265,195267-195278,195280-195364,195366,195369-195588,195590-195762,195764-195797,195799-195948,195950-195991,195993-196071,196073-196113,196115-196186,196189-196226,196228-196245,196247-196267,196269,196271,196273-196307,196309-196343,196345-196376,196378-196380,196382-196416,196418-196455,196457-196487,196489-196519,196521-196553,196555-196584,196586-196621,196623-196724,196726-196757,196759-196791,196793-196892,196894-196906,196908-196944,196947,196949-197024,197026-197124,197126-197188,197190-197264,197267-197334,197336-197337,197339-197373,197375-197405,197407-197408,197410-197430,197432-197527,197529-197534,197536-197569,197571-197615,197617-197700,197702-197737,197739,197741-197774,197776,197778-197823,197825-197827,197829-197860,197862-197925,197927-197958,197961-197995,197997-198063,198065-198082,198084-198087,198089-198138,198140-198145,198147-198181,198184-198185,198187-198216,198218-198247,198249-198433,198435-198436,198439-198441,198443-198469,198471-198497,198499,198501-198510,198512-198528,198531-198557,198559-198560,198562-198564,198566-198596,198598-198660,198662-198665,198667-198669,198671-198724,198726,198728,198730-198761,198763-198891,198893-198953,198955-198957,198959-199090,199092-199367,199369,199371,199373,199375,199377-199408,199410,199412,199414-199445,199447-199478,199480-199513,199515-199546,199548-199587,199589-199695,199697-199742,199744-199922,199924-199957,199959-199999,200001-200037,200039-200107,200109-200189,200191-200253,200255-200289,200291-200325,200327-200427,200429,200431-200476,200478-200518,200520-200583,200585-200586,200588-200619,200621-200655,200657-200689,200726,200764,200943,200946,200985,201056-201090,201223,201262,201381,201445,201458,201462,201610,201678,201783,201829,201994,202183,202258,202262,202337,202343,202415,202417,202497,202574,202603,202672,202753,202761,202925,202967,203037,203116,203231,203376,203381,203444,203672,203699,203710,203721,203779,203802,203853,203909,204247,204301,204470,204475,204563,204710,204835,204948,205120,205151,205196,205216,205291,205350,205412,205479,205532,205600,205696,205770,205776,205840,205878,205939,205985,206341,206386,206489,206567,206636,206702,206707,206768,206808,206868,206873,206939,207029,207095,207156,207361,207424,207680,207723,207854,207946,208263,208314,208383,208388,208464,208548,208588,208593,208749,208924,209056,209098,209132,209256,209279,209317,209554,209711,209760-209761,209839,209887,210238,210564,210640,210817,210908,210914,210992,211040,211113,211232,211275,211347,211539