Index: pbx/pbx_config.c =================================================================== --- pbx/pbx_config.c (revision 211527) +++ pbx/pbx_config.c (revision 211528) @@ -1423,7 +1423,7 @@ if (!strcmp(prior, "hint")) { iprior = PRIORITY_HINT; } else { - if (sscanf(prior, "%d", &iprior) != 1) { + if (sscanf(prior, "%30d", &iprior) != 1) { ast_cli(fd, "'%s' is not a valid priority\n", prior); prior = NULL; } @@ -1516,7 +1516,7 @@ if (!strcmp(prior, "hint")) { iprior = PRIORITY_HINT; } else { - if (sscanf(prior, "%d", &iprior) != 1) { + if (sscanf(prior, "%30d", &iprior) != 1) { ast_cli(fd, "'%s' is not a valid priority\n", prior); prior = NULL; } @@ -2248,7 +2248,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; @@ -2395,9 +2395,9 @@ c = zapcopy; 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 211527) +++ pbx/pbx_loopback.c (revision 211528) @@ -129,7 +129,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 211527) +++ pbx/pbx_spool.c (revision 211528) @@ -190,7 +190,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; } @@ -201,24 +201,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_ael.c =================================================================== --- pbx/pbx_ael.c (revision 211527) +++ pbx/pbx_ael.c (revision 211528) @@ -877,12 +877,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++; @@ -974,7 +974,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++; @@ -986,7 +986,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: pbx/pbx_dundi.c =================================================================== --- pbx/pbx_dundi.c (revision 211527) +++ pbx/pbx_dundi.c (revision 211528) @@ -1145,7 +1145,7 @@ if (expiration > 0) { ast_log(LOG_DEBUG, "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) { @@ -4043,7 +4043,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 < 60000)) { + if ((sscanf(fields[1], "%30d", &map->weight) == 1) && (map->weight >= 0) && (map->weight < 60000)) { ast_copy_string(map->dest, fields[3], sizeof(map->dest)); if ((map->tech = str2tech(fields[2]))) { map->dead = 0; @@ -4141,7 +4141,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; @@ -4238,7 +4238,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; @@ -4473,14 +4473,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 @@ -4496,7 +4496,7 @@ else ast_log(LOG_WARNING, "Invalid global endpoint identifier '%s' at line %d\n", v->value, v->lineno); } else if (!strcasecmp(v->name, "tos")) { - if (sscanf(v->value, "%d", &format) == 1) + if (sscanf(v->value, "%30d", &format) == 1) tos = format & 0xff; else if (!strcasecmp(v->value, "lowdelay")) tos = IPTOS_LOWDELAY; @@ -4533,7 +4533,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 211527) +++ pbx/dundi-parser.c (revision 211528) @@ -91,7 +91,7 @@ { 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; for (x=0;x<6;x++) Index: channels/misdn_config.c =================================================================== --- channels/misdn_config.c (revision 211527) +++ channels/misdn_config.c (revision 211528) @@ -891,9 +891,9 @@ { char *pat; if (strchr(value,'x')) - pat="%x"; + pat="%30x"; else - pat="%d"; + pat="%30d"; if (sscanf(value, pat, &tmp)) { dest->num = (int *)malloc(sizeof(int)); memcpy(dest->num, &tmp, sizeof(int)); @@ -907,7 +907,7 @@ break; case MISDN_CTYPE_BOOLINT: dest->num = (int *)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); @@ -974,7 +974,7 @@ for (token = strsep(&v->value, ","); token; token = strsep(&v->value, ","), *ptpbuf = 0) { if (!*token) continue; - if (sscanf(token, "%d-%d%s", &start, &end, ptpbuf) >= 2) { + if (sscanf(token, "%30d-%30d%s", &start, &end, ptpbuf) >= 2) { for (; start <= end; start++) { if (start <= max_ports && start > 0) { cfg_for_ports[start] = 1; @@ -983,7 +983,7 @@ CLI_ERROR(v->name, v->value, cat); } } else { - if (sscanf(token, "%d%s", &start, ptpbuf)) { + if (sscanf(token, "%30d%s", &start, ptpbuf)) { if (start <= max_ports && start > 0) { cfg_for_ports[start] = 1; ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0; Index: channels/chan_phone.c =================================================================== --- channels/chan_phone.c (revision 211527) +++ channels/chan_phone.c (revision 211528) @@ -1243,7 +1243,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 211527) +++ channels/chan_dahdi.c (revision 211528) @@ -8318,7 +8318,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; } @@ -8354,7 +8354,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%c%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; @@ -8377,7 +8377,7 @@ p = pris[x].crvs; } #endif - else if ((res = sscanf(s, "%d%c%d", &x, &opt, &y)) < 1) { + 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 { @@ -10626,7 +10626,7 @@ return RESULT_SHOWUSAGE; #ifdef HAVE_PRI if ((c = strchr(argv[3], ':'))) { - if (sscanf(argv[3], "%d:%d", &trunkgroup, &channel) != 2) + if (sscanf(argv[3], "%30d:%30d", &trunkgroup, &channel) != 2) return RESULT_SHOWUSAGE; if ((trunkgroup < 1) || (channel < 1)) return RESULT_SHOWUSAGE; @@ -11253,7 +11253,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; } @@ -11276,9 +11276,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")) { @@ -11353,7 +11353,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; @@ -11386,11 +11386,11 @@ } else if (!strcasecmp(v->name, "dring3context")) { ast_copy_string(drings.ringContext[2].contextData, v->value, sizeof(drings.ringContext[2].contextData)); } else if (!strcasecmp(v->name, "dring1")) { - sscanf(v->value, "%d,%d,%d", &drings.ringnum[0].ring[0], &drings.ringnum[0].ring[1], &drings.ringnum[0].ring[2]); + sscanf(v->value, "%30d,%30d,%30d", &drings.ringnum[0].ring[0], &drings.ringnum[0].ring[1], &drings.ringnum[0].ring[2]); } else if (!strcasecmp(v->name, "dring2")) { - sscanf(v->value, "%d,%d,%d", &drings.ringnum[1].ring[0], &drings.ringnum[1].ring[1], &drings.ringnum[1].ring[2]); + sscanf(v->value, "%30d,%30d,%30d", &drings.ringnum[1].ring[0], &drings.ringnum[1].ring[1], &drings.ringnum[1].ring[2]); } else if (!strcasecmp(v->name, "dring3")) { - sscanf(v->value, "%d,%d,%d", &drings.ringnum[2].ring[0], &drings.ringnum[2].ring[1], &drings.ringnum[2].ring[2]); + sscanf(v->value, "%30d,%30d,%30d", &drings.ringnum[2].ring[0], &drings.ringnum[2].ring[1], &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")) { @@ -11445,7 +11445,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\n"); } } else if (!strcasecmp(v->name, "callprogress")) { @@ -11477,7 +11477,7 @@ confp->chan.echocancel=128; } } 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 { @@ -11525,15 +11525,15 @@ } else if (!strcasecmp(v->name, "transfertobusy")) { confp->chan.transfertobusy = ast_true(v->value); } 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\n", v->value); } } 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\n", v->value); } } 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\n", v->value); } } else if (!strcasecmp(v->name, "callerid")) { @@ -11897,7 +11897,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_h323.c =================================================================== --- channels/chan_h323.c (revision 211527) +++ channels/chan_h323.c (revision 211528) @@ -2890,7 +2890,7 @@ memcpy(&bindaddr.sin_addr, hp->h_addr, sizeof(bindaddr.sin_addr)); } } else if (!strcasecmp(v->name, "tos")) { - if (sscanf(v->value, "%d", &format)) { + if (sscanf(v->value, "%30d", &format)) { tos = format & 0xff; } else if (!strcasecmp(v->value, "lowdelay")) { tos = IPTOS_LOWDELAY; Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 211527) +++ channels/chan_sip.c (revision 211528) @@ -2086,7 +2086,7 @@ if (resp) { ast_set_flag(pkt, FLAG_RESPONSE); /* 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; } } @@ -2144,7 +2144,7 @@ if (option_debug > 2) ast_log(LOG_DEBUG, "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)) { ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); } @@ -2994,7 +2994,7 @@ if (sin) { memcpy(&dialog->sa.sin_addr, &sin->sin_addr, sizeof(dialog->sa.sin_addr)); if (!sin->sin_port) { - if (ast_strlen_zero(port) || sscanf(port, "%u", &portno) != 1) { + if (ast_strlen_zero(port) || sscanf(port, "%30u", &portno) != 1) { portno = STANDARD_SIP_PORT; } } else { @@ -5062,7 +5062,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; } @@ -5192,10 +5192,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. @@ -5332,8 +5332,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++; @@ -5343,7 +5343,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; } @@ -5351,8 +5351,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)) { /* If it is not audio - is it video ? */ ast_clear_flag(&p->flags[0], SIP_NOVIDEO); p->offered_media[SDP_VIDEO].offered = TRUE; @@ -5362,7 +5362,7 @@ codecs = m + len; ast_copy_string(p->offered_media[SDP_VIDEO].text, codecs, sizeof(p->offered_media[SDP_VIDEO].text)); for (codecs = m + len; !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; } @@ -5370,8 +5370,8 @@ ast_verbose("Found RTP video format %d\n", codec); ast_rtp_set_m_type(newvideortp, 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; @@ -5557,7 +5557,7 @@ ast_rtp_codec_setpref(p->rtp, pref); } continue; - } else if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) == 2) { + } else if (sscanf(a, "rtpmap: %30u %[^/]/", &codec, mimeSubtype) == 2) { /* We have a rtpmap to handle */ int found = FALSE; /* We should propably check if this is an audio or video codec @@ -5607,11 +5607,11 @@ /* 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; if (option_debug > 2) ast_log(LOG_DEBUG, "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; if (option_debug > 2) ast_log(LOG_DEBUG,"T38MaxBitRate: %d\n",x); @@ -5635,7 +5635,7 @@ peert38capability |= T38FAX_RATE_2400; break; } - } else if ((sscanf(a, "T38FaxVersion:%d", &x) == 1)) { + } else if ((sscanf(a, "T38FaxVersion:%30d", &x) == 1)) { found = 1; if (option_debug > 2) ast_log(LOG_DEBUG, "FaxVersion: %d\n",x); @@ -5643,7 +5643,7 @@ peert38capability |= T38FAX_VERSION_0; else if (x == 1) peert38capability |= T38FAX_VERSION_1; - } 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; if (option_debug > 2) ast_log(LOG_DEBUG, "FaxMaxDatagram: %d\n",x); @@ -5651,7 +5651,7 @@ ast_udptl_set_local_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)) { if (option_debug > 2) ast_log(LOG_DEBUG, "FillBitRemoval: %d\n",x); if (x == 1) @@ -5663,7 +5663,7 @@ } } else if ((strncmp(a, "T38FaxTranscodingMMR", 20) == 0)) { found = 1; - if ((sscanf(a, "T38FaxTranscodingMMR:%d", &x) == 1)) { + if ((sscanf(a, "T38FaxTranscodingMMR:%30d", &x) == 1)) { if (option_debug > 2) ast_log(LOG_DEBUG, "Transcoding MMR: %d\n",x); if (x == 1) @@ -5675,7 +5675,7 @@ } } else if ((strncmp(a, "T38FaxTranscodingJBIG", 21) == 0)) { found = 1; - if ((sscanf(a, "T38FaxTranscodingJBIG:%d", &x) == 1)) { + if ((sscanf(a, "T38FaxTranscodingJBIG:%30d", &x) == 1)) { if (option_debug > 2) ast_log(LOG_DEBUG, "Transcoding JBIG: %d\n",x); if (x == 1) @@ -6357,7 +6357,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; } @@ -6499,7 +6499,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; } @@ -6993,7 +6993,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; } @@ -7031,7 +7031,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; } @@ -8467,7 +8467,7 @@ if (expires) { /* XXX bug here, we overwrite the string */ expires = strsep((char **) &expires, ";"); /* 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 */ @@ -12281,7 +12281,7 @@ if (!args.number) { number = 1; } else { - sscanf(args.number, "%d", &number); + sscanf(args.number, "%30d", &number); if (number < 1) number = 1; } @@ -13097,7 +13097,7 @@ } tmptmp = strcasestr(contact, "expires="); if (tmptmp) { - if (sscanf(tmptmp + 8, "%d;", &expires) != 1) + if (sscanf(tmptmp + 8, "%30d;", &expires) != 1) expires = 0; } @@ -16171,7 +16171,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; } @@ -16196,7 +16196,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; } @@ -17712,7 +17712,7 @@ 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")) @@ -17867,17 +17867,17 @@ } 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; } @@ -17896,7 +17896,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; } @@ -18164,24 +18164,24 @@ } else if (!strcasecmp(v->name, "relaxdtmf")) { global_relaxdtmf = ast_true(v->value); } else if (!strcasecmp(v->name, "checkmwi")) { - if ((sscanf(v->value, "%d", &global_mwitime) != 1) || (global_mwitime < 0)) { + if ((sscanf(v->value, "%30d", &global_mwitime) != 1) || (global_mwitime < 0)) { ast_log(LOG_WARNING, "'%s' is not a valid MWI time setting at line %d. Using default (10).\n", v->value, v->lineno); global_mwitime = DEFAULT_MWITIME; } } 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; } @@ -18226,7 +18226,7 @@ ast_log(LOG_WARNING, "Unable to locate host '%s'\n", v->value); } else if (!strcasecmp(v->name, "outboundproxyport")) { /* Port needs to be after IP */ - sscanf(v->value, "%d", &format); + sscanf(v->value, "%30d", &format); outboundproxyip.sin_port = htons(format); } else if (!strcasecmp(v->name, "autocreatepeer")) { autocreatepeer = ast_true(v->value); @@ -18287,7 +18287,7 @@ memcpy(&externip.sin_addr, hp->h_addr, sizeof(externip.sin_addr)); externexpire = time(NULL); } 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; } @@ -18335,7 +18335,7 @@ if (ast_str2tos(v->value, &global_tos_video)) ast_log(LOG_WARNING, "Invalid tos_video value at line %d, recommended value is 'af41'. See doc/ip-tos.txt.\n", v->lineno); } 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 port number '%s' at line %d of %s\n", v->value, v->lineno, config); @@ -18345,7 +18345,7 @@ 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; } @@ -18962,7 +18962,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 211527) +++ channels/chan_agent.c (revision 211528) @@ -1444,9 +1444,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 @@ -2672,9 +2672,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); waitforagent = 1; } else Index: channels/iax2-provision.c =================================================================== --- channels/iax2-provision.c (revision 211527) +++ channels/iax2-provision.c (revision 211528) @@ -246,7 +246,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) @@ -305,7 +305,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 211527) +++ channels/chan_iax2.c (revision 211528) @@ -9837,18 +9837,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")) { @@ -10392,7 +10392,7 @@ if (trunkfreq < 10) trunkfreq = 10; } 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 211527) +++ channels/chan_oss.c (revision 211528) @@ -1577,7 +1577,7 @@ static void store_boost(struct chan_oss_pvt *o, 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 211527) +++ channels/chan_misdn.c (revision 211528) @@ -1135,7 +1135,7 @@ } return ok ? 0 : RESULT_SHOWUSAGE; } - if (!sscanf(argv[3], "%d", &onlyport) || onlyport < 0) { + if (!sscanf(argv[3], "%30d", &onlyport) || onlyport < 0) { ast_cli(fd, "Unknown option: %s\n", argv[3]); return RESULT_SHOWUSAGE; } Index: channels/chan_skinny.c =================================================================== --- channels/chan_skinny.c (revision 211527) +++ channels/chan_skinny.c (revision 211528) @@ -4760,7 +4760,7 @@ } else if (!strcasecmp(v->name, "disallow")) { ast_parse_allow_disallow(&default_prefs, &default_capability, v->value, 0); } else if (!strcasecmp(v->name, "bindport") || !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 bindport '%s' at line %d of %s\n", v->value, v->lineno, config); Index: channels/chan_mgcp.c =================================================================== --- channels/chan_mgcp.c (revision 211527) +++ channels/chan_mgcp.c (revision 211528) @@ -1863,7 +1863,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; } @@ -1878,7 +1878,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); @@ -1894,7 +1894,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 %[^/]/", &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); @@ -2028,7 +2028,7 @@ if (mgr) { /* Store MGCP response in case we have to retransmit */ memset(mgr, 0, sizeof(struct mgcp_response)); - 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); @@ -3320,7 +3320,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) { @@ -3378,7 +3378,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) { @@ -4170,7 +4170,7 @@ else capability &= ~format; } else if (!strcasecmp(v->name, "tos")) { - if (sscanf(v->value, "%d", &format) == 1) + if (sscanf(v->value, "%30d", &format) == 1) tos = format & 0xff; else if (!strcasecmp(v->value, "lowdelay")) tos = IPTOS_LOWDELAY; @@ -4185,7 +4185,7 @@ else ast_log(LOG_WARNING, "Invalid tos value at line %d, should be 'lowdelay', 'throughput', 'reliability', 'mincost', or 'none'\n", v->lineno); } else if (!strcasecmp(v->name, "port")) { - if (sscanf(v->value, "%d", &ourport) == 1) { + if (sscanf(v->value, "%30d", &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 211527) +++ agi/eagi-test.c (revision 211528) @@ -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 211527) +++ agi/eagi-sphinx-test.c (revision 211528) @@ -214,7 +214,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_chanspy.c =================================================================== --- apps/app_chanspy.c (revision 211527) +++ apps/app_chanspy.c (revision 211528) @@ -735,7 +735,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; @@ -820,7 +820,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 211527) +++ apps/app_adsiprog.c (revision 211528) @@ -195,7 +195,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 */ @@ -205,7 +205,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 */ @@ -215,7 +215,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 211527) +++ apps/app_alarmreceiver.c (revision 211528) @@ -125,7 +125,7 @@ return; } - sscanf(value, "%u", &v); + sscanf(value, "%30u", &v); v++; if(option_verbose >= 4) Index: apps/app_talkdetect.c =================================================================== --- apps/app_talkdetect.c (revision 211527) +++ apps/app_talkdetect.c (revision 211528) @@ -89,15 +89,15 @@ strsep(&stringp, "|"); options = strsep(&stringp, "|"); if (options) { - if ((sscanf(options, "%d", &x) == 1) && (x > 0)) + if ((sscanf(options, "%30d", &x) == 1) && (x > 0)) sil = x; options = strsep(&stringp, "|"); if (options) { - if ((sscanf(options, "%d", &x) == 1) && (x > 0)) + if ((sscanf(options, "%30d", &x) == 1) && (x > 0)) min = x; options = strsep(&stringp, "|"); if (options) { - if ((sscanf(options, "%d", &x) == 1) && (x > 0)) + if ((sscanf(options, "%30d", &x) == 1) && (x > 0)) max = x; } } Index: apps/app_setcallerid.c =================================================================== --- apps/app_setcallerid.c (revision 211527) +++ apps/app_setcallerid.c (revision 211528) @@ -72,7 +72,7 @@ u = ast_module_user_add(chan); /* 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 211527) +++ apps/app_rpt.c (revision 211528) @@ -1522,7 +1522,7 @@ if (str == NULL) return -1; /* leave this %i alone, non-base-10 input is useful here */ - if (sscanf(str,"%i",&ret) != 1) return -1; + if (sscanf(str,"%30i",&ret) != 1) return -1; return ret; } @@ -1697,7 +1697,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 ((!val) || (sscanf(val,"%i",&rpt_vars[n].p.iobase) != 1)) + if ((!val) || (sscanf(val,"%30i",&rpt_vars[n].p.iobase) != 1)) rpt_vars[n].p.iobase = DEFAULT_IOBASE; val = (char *) ast_variable_retrieve(cfg,this,"ioport"); rpt_vars[n].p.ioport = val; @@ -2641,7 +2641,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) @@ -3983,7 +3983,7 @@ p = strstr(tdesc, "version"); if(!p) break; - if(sscanf(p, "version %d.%d", &vmajor, &vminor) != 2) + if(sscanf(p, "version %30d.%30d", &vmajor, &vminor) != 2) break; wait_interval(myrpt, DLY_TELEM, mychannel); /* Wait a little bit */ /* Say "version" */ @@ -5303,6 +5303,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 tmp[512],cmd[300] = "",dest[300],src[300],c; int seq, res; struct rpt_link *l; @@ -5336,7 +5338,9 @@ } if (tmp[0] == 'I') { - if (sscanf(tmp,"%s %s %x",cmd,src,&seq) != 3) + /* XXX WARNING: be very careful with the limits on the folowing + * sscanf() call, make sure they match the values defined above */ + if (sscanf(tmp,"%299s %299s %30x",cmd,src,&seq) != 3) { ast_log(LOG_WARNING, "Unable to parse ident string %s\n",str); return; @@ -5346,7 +5350,9 @@ } else { - if (sscanf(tmp,"%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(tmp,"%299s %299s %299s %30d %1c",cmd,dest,src,&seq,&c) != 5) { ast_log(LOG_WARNING, "Unable to parse link string %s\n",str); return; @@ -8332,6 +8338,8 @@ 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 tmp[300],cmd[300],dest[300],src[300],c; int seq,res; @@ -8342,7 +8350,9 @@ #ifndef DO_NOT_NOTIFY_MDC1200_ON_REMOTE_BASES if (tmp[0] == 'I') { - if (sscanf(tmp,"%s %s %x",cmd,src,&seq) != 3) + /* XXX WARNING: be very careful with the limits on the folowing + * sscanf() call, make sure they match the values defined above */ + if (sscanf(tmp,"%299s %299s %30x",cmd,src,&seq) != 3) { ast_log(LOG_WARNING, "Unable to parse ident string %s\n",str); return 0; @@ -8351,7 +8361,9 @@ return 0; } #endif - if (sscanf(tmp,"%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(tmp,"%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 211527) +++ apps/app_mixmonitor.c (revision 211528) @@ -451,7 +451,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); @@ -461,7 +461,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); @@ -471,7 +471,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 211527) +++ apps/app_readfile.c (revision 211528) @@ -80,7 +80,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 211527) +++ apps/app_meetme.c (revision 211528) @@ -835,7 +835,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: @@ -1403,7 +1403,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, "%30d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024)) conf_map[confno_int] = 0; conf_free(conf); res = 1; @@ -1537,7 +1537,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; } @@ -2794,7 +2794,7 @@ if (!res) ast_waitstream(chan, ""); } else { - if (sscanf(confno, "%d", &confno_int) == 1) { + if (sscanf(confno, "%30d", &confno_int) == 1) { res = ast_streamfile(chan, "conf-enteringno", chan->language); if (!res) { ast_waitstream(chan, ""); @@ -2917,7 +2917,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) @@ -3251,7 +3251,7 @@ return; 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)) { @@ -4707,7 +4707,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; @@ -4783,13 +4783,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; @@ -4838,13 +4838,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 211527) +++ apps/app_morsecode.c (revision 211528) @@ -123,13 +123,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_macro.c =================================================================== --- apps/app_macro.c (revision 211527) +++ apps/app_macro.c (revision 211528) @@ -220,18 +220,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"); @@ -511,7 +511,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 211527) +++ apps/app_sms.c (revision 211528) @@ -747,7 +747,7 @@ H, M, S; - if (sscanf (p, "%d-%d-%dT%d:%d:%d", &Y, &m, &d, &H, &M, &S) == 6) + if (sscanf (p, "%30d-%30d-%30dT%30d:%30d:%30d", &Y, &m, &d, &H, &M, &S) == 6) { struct tm t; t.tm_year = Y - 1900; Index: apps/app_verbose.c =================================================================== --- apps/app_verbose.c (revision 211527) +++ apps/app_verbose.c (revision 211528) @@ -65,7 +65,7 @@ vtext = ast_strdupa(data); tmp = strsep(&vtext, "|"); if (vtext) { - if (sscanf(tmp, "%d", &vsize) != 1) { + if (sscanf(tmp, "%30d", &vsize) != 1) { vsize = 0; ast_log(LOG_WARNING, "'%s' is not a verboser number\n", vtext); } Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 211527) +++ apps/app_voicemail.c (revision 211528) @@ -647,7 +647,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"); @@ -672,7 +672,7 @@ vmu->maxmsg = 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); } @@ -2421,7 +2421,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); @@ -2467,7 +2467,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); @@ -3034,7 +3034,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) { time_t ttime = inttime; struct tm tm; ast_localtime(&ttime, &tm, NULL); @@ -3354,7 +3354,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) { time_t ttime = inttime; struct tm tm; ast_localtime(&ttime, &tm, NULL); @@ -7373,7 +7373,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]); ast_module_user_remove(u); return -1; @@ -7387,7 +7387,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 { @@ -7924,7 +7924,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]); ast_module_user_remove(u); return -1; @@ -8345,7 +8345,7 @@ volgain = 0.0; if ((volgainstr = ast_variable_retrieve(cfg, "general", "volgain"))) - sscanf(volgainstr, "%lf", &volgain); + sscanf(volgainstr, "%30lf", &volgain); #ifdef ODBC_STORAGE strcpy(odbc_database, "asterisk"); @@ -8499,7 +8499,7 @@ vmmaxmessage = 0; if ((s = ast_variable_retrieve(cfg, "general", "maxmessage"))) { - if (sscanf(s, "%d", &x) == 1) { + if (sscanf(s, "%30d", &x) == 1) { vmmaxmessage = x; } else { ast_log(LOG_WARNING, "Invalid max message time length\n"); @@ -8508,7 +8508,7 @@ vmminmessage = 0; if ((s = ast_variable_retrieve(cfg, "general", "minmessage"))) { - if (sscanf(s, "%d", &x) == 1) { + if (sscanf(s, "%30d", &x) == 1) { vmminmessage = x; if (maxsilence / 1000 >= vmminmessage) ast_log(LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n"); @@ -8523,7 +8523,7 @@ skipms = 3000; if ((s = ast_variable_retrieve(cfg, "general", "maxgreet"))) { - if (sscanf(s, "%d", &x) == 1) { + if (sscanf(s, "%30d", &x) == 1) { maxgreet = x; } else { ast_log(LOG_WARNING, "Invalid max message greeting length\n"); @@ -8531,7 +8531,7 @@ } if ((s = ast_variable_retrieve(cfg, "general", "skipms"))) { - if (sscanf(s, "%d", &x) == 1) { + if (sscanf(s, "%30d", &x) == 1) { skipms = x; } else { ast_log(LOG_WARNING, "Invalid skipms value\n"); @@ -8540,7 +8540,7 @@ maxlogins = 3; if ((s = ast_variable_retrieve(cfg, "general", "maxlogins"))) { - if (sscanf(s, "%d", &x) == 1) { + if (sscanf(s, "%30d", &x) == 1) { maxlogins = x; } else { ast_log(LOG_WARNING, "Invalid max failed login attempts\n"); @@ -8629,7 +8629,7 @@ saydurationminfo = 2; if ((astsaydurationminfo = ast_variable_retrieve(cfg, "general", "saydurationm"))) { - if (sscanf(astsaydurationminfo, "%d", &x) == 1) { + if (sscanf(astsaydurationminfo, "%30d", &x) == 1) { saydurationminfo = x; } else { ast_log(LOG_WARNING, "Invalid min duration for say duration\n"); Index: apps/app_dial.c =================================================================== --- apps/app_dial.c (revision 211527) +++ apps/app_dial.c (revision 211528) @@ -1863,7 +1863,7 @@ if ((dialdata = strchr(announce, '|'))) { *dialdata++ = '\0'; - if (sscanf(dialdata, "%d", &sleep) == 1) { + if (sscanf(dialdata, "%30d", &sleep) == 1) { sleep *= 1000; } else { ast_log(LOG_ERROR, "%s requires the numerical argument \n",rapp); @@ -1871,7 +1871,7 @@ } if ((dialdata = strchr(dialdata, '|'))) { *dialdata++ = '\0'; - if (sscanf(dialdata, "%d", &loops) != 1) { + if (sscanf(dialdata, "%30d", &loops) != 1) { ast_log(LOG_ERROR, "%s requires the numerical argument \n",rapp); goto done; } Index: apps/app_waitforsilence.c =================================================================== --- apps/app_waitforsilence.c (revision 211527) +++ apps/app_waitforsilence.c (revision 211528) @@ -167,9 +167,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 211527) +++ apps/app_disa.c (revision 211528) @@ -240,7 +240,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); @@ -266,7 +266,7 @@ ast_log(LOG_DEBUG, "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 211527) +++ apps/app_osplookup.c (revision 211528) @@ -208,7 +208,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_log(LOG_DEBUG, "OSP: maxconnections '%d'\n", t); } else { @@ -216,7 +216,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_log(LOG_DEBUG, "OSP: retrydelay '%d'\n", t); } else { @@ -224,7 +224,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_log(LOG_DEBUG, "OSP: retrylimit '%d'\n", t); } else { @@ -232,7 +232,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_log(LOG_DEBUG, "OSP: timeout '%d'\n", t); } else { @@ -243,7 +243,7 @@ ast_copy_string(p->source, v->value, sizeof(p->source)); ast_log(LOG_DEBUG, "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_log(LOG_DEBUG, "OSP: authpolicy '%d'\n", t); } else { @@ -1051,11 +1051,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), "OSPPEERIP")) { @@ -1177,7 +1177,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_log(LOG_DEBUG, "OSPNext: cause '%d'\n", cause); @@ -1195,19 +1195,19 @@ 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), "OSPRESULTS")) { - if (sscanf(ast_var_value(current), "%d", &result.numresults) != 1) { + if (sscanf(ast_var_value(current), "%30d", &result.numresults) != 1) { result.numresults = 0; } } @@ -1322,11 +1322,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 && @@ -1343,7 +1343,7 @@ ast_log(LOG_DEBUG, "OSPFinish: OSPOUTHANDLE '%d'\n", outhandle); ast_log(LOG_DEBUG, "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_log(LOG_DEBUG, "OSPFinish: cause '%d'\n", cause); @@ -1435,7 +1435,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 211527) +++ apps/app_dahdibarge.c (revision 211528) @@ -277,15 +277,15 @@ if (!ast_strlen_zero(data)) { if (dahdimode) { - 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, "Argument (if specified) must be a channel number, not '%s'\n", (char *) data); ast_module_user_remove(u); return 0; } } else { - if ((sscanf(data, "Zap/%d", &confno) != 1) && - (sscanf(data, "%d", &confno) != 1)) { + if ((sscanf(data, "Zap/%30d", &confno) != 1) && + (sscanf(data, "%30d", &confno) != 1)) { ast_log(LOG_WARNING, "Argument (if specified) must be a channel number, not '%s'\n", (char *) data); ast_module_user_remove(u); return 0; @@ -301,7 +301,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 211527) +++ apps/app_privacy.c (revision 211528) @@ -115,13 +115,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"); @@ -138,14 +138,14 @@ cfg = ast_config_load(PRIV_CONFIG); if (cfg && (s = ast_variable_retrieve(cfg, "general", "maxretries"))) { - if (sscanf(s, "%d", &x) == 1) + if (sscanf(s, "%30d", &x) == 1) maxretries = x; else ast_log(LOG_WARNING, "Invalid max retries argument\n"); } if (cfg && (s = ast_variable_retrieve(cfg, "general", "minlength"))) { - if (sscanf(s, "%d", &x) == 1) + if (sscanf(s, "%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 211527) +++ apps/app_record.c (revision 211528) @@ -140,7 +140,7 @@ return -1; } if (silstr) { - if ((sscanf(silstr, "%d", &i) == 1) && (i > -1)) { + if ((sscanf(silstr, "%30d", &i) == 1) && (i > -1)) { silence = i * 1000; } else if (!ast_strlen_zero(silstr)) { ast_log(LOG_WARNING, "'%s' is not a valid silence duration\n", silstr); @@ -148,7 +148,7 @@ } if (maxstr) { - if ((sscanf(maxstr, "%d", &i) == 1) && (i > -1)) + if ((sscanf(maxstr, "%30d", &i) == 1) && (i > -1)) /* Convert duration to milliseconds */ maxduration = i * 1000; else if (!ast_strlen_zero(maxstr)) Index: apps/app_random.c =================================================================== --- apps/app_random.c (revision 211527) +++ apps/app_random.c (revision 211528) @@ -71,7 +71,7 @@ s = ast_strdupa(data); prob = strsep(&s,":"); - if ((!prob) || (sscanf(prob, "%d", &probint) != 1)) + if ((!prob) || (sscanf(prob, "%30d", &probint) != 1)) probint = 0; if (!deprecated) { Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 211527) +++ apps/app_queue.c (revision 211528) @@ -3822,7 +3822,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; } @@ -3961,7 +3961,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) { if (option_debug) ast_log(LOG_DEBUG, "%s: Got priority %d from ${QUEUE_PRIO}.\n", chan->name, prio); @@ -3978,7 +3978,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) { if (option_debug) ast_log(LOG_DEBUG, "%s: Got max penalty %d from ${QUEUE_MAX_PENALTY}.\n", chan->name, max_penalty); @@ -4865,7 +4865,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)) @@ -4969,7 +4969,7 @@ queuename = argv[5]; interface = argv[3]; if (argc >= 8) { - if (sscanf(argv[7], "%d", &penalty) == 1) { + if (sscanf(argv[7], "%30d", &penalty) == 1) { if (penalty < 0) { ast_cli(fd, "Penalty must be >= 0\n"); penalty = 0; Index: apps/app_followme.c =================================================================== --- apps/app_followme.c (revision 211527) +++ apps/app_followme.c (revision 211528) @@ -315,7 +315,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 211527) +++ apps/app_waitforring.c (revision 211528) @@ -60,7 +60,7 @@ int res = 0; int ms; - if (!data || (sscanf(data, "%d", &ms) != 1)) { + if (!data || (sscanf(data, "%30d", &ms) != 1)) { ast_log(LOG_WARNING, "WaitForRing requires an argument (minimum seconds)\n"); return 0; } Index: doc/CODING-GUIDELINES =================================================================== --- doc/CODING-GUIDELINES (revision 211527) +++ doc/CODING-GUIDELINES (revision 211528) @@ -284,6 +284,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 conversion 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 211527) +++ funcs/func_rand.c (revision 211528) @@ -53,10 +53,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_math.c =================================================================== --- funcs/func_math.c (revision 211527) +++ funcs/func_math.c (revision 211528) @@ -165,12 +165,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_strings.c =================================================================== --- funcs/func_strings.c (revision 211527) +++ funcs/func_strings.c (revision 211528) @@ -289,7 +289,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; } @@ -312,7 +312,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_cut.c =================================================================== --- funcs/func_cut.c (revision 211527) +++ funcs/func_cut.c (revision 211528) @@ -96,7 +96,7 @@ } *ptrvalue++ = '\0'; sortable_keys[count2].key = ptrkey; - sscanf(ptrvalue, "%f", &sortable_keys[count2].value); + sscanf(ptrvalue, "%30f", &sortable_keys[count2].value); count2++; } @@ -173,15 +173,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 211527) +++ funcs/func_channel.c (revision 211528) @@ -116,10 +116,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 211527) +++ main/utils.c (revision 211528) @@ -1349,7 +1349,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/cdr.c =================================================================== --- main/cdr.c (revision 211527) +++ main/cdr.c (revision 211528) @@ -1428,7 +1428,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); @@ -1436,7 +1436,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 211527) +++ main/channel.c (revision 211528) @@ -4785,9 +4785,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 211527) +++ main/manager.c (revision 211528) @@ -1329,7 +1329,7 @@ snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id); if (!ast_strlen_zero(timeouts)) { - sscanf(timeouts, "%i", &timeout); + sscanf(timeouts, "%30i", &timeout); } ast_mutex_lock(&s->session->__lock); @@ -1690,7 +1690,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; @@ -1938,13 +1938,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; } @@ -2790,7 +2790,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; } } @@ -3068,7 +3068,7 @@ webenabled = ast_true(val); if ((val = ast_variable_retrieve(cfg, "general", "port"))) { - if (sscanf(val, "%d", &portno) != 1) { + if (sscanf(val, "%5d", &portno) != 1) { ast_log(LOG_WARNING, "Invalid port number '%s'\n", val); portno = DEFAULT_MANAGER_PORT; } Index: main/acl.c =================================================================== --- main/acl.c (revision 211527) +++ main/acl.c (revision 211528) @@ -328,7 +328,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)) { y = 0; for (z = 0; z < x; z++) { y >>= 1; @@ -447,7 +447,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 211527) +++ main/asterisk.c (revision 211528) @@ -1117,7 +1117,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)); @@ -1891,10 +1891,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; } @@ -1940,13 +1940,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, "%30d", &which) == 1) { switch (which) { case 1: snprintf(p, sizeof(prompt) - strlen(prompt), "%.2f", avg1); @@ -2582,7 +2582,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 @@ -2630,7 +2630,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")) { @@ -2639,7 +2639,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; } /* What user to run as */ @@ -2774,11 +2774,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 211527) +++ main/frame.c (revision 211528) @@ -765,7 +765,7 @@ if (argc != 3) return RESULT_SHOWUSAGE; - if (sscanf(argv[2],"%d",&codec) != 1) + if (sscanf(argv[2],"%30d",&codec) != 1) return RESULT_SHOWUSAGE; for (i = 0; i < 32; i++) @@ -787,7 +787,7 @@ if (argc != 4) return RESULT_SHOWUSAGE; - if (sscanf(argv[3],"%d",&codec) != 1) + if (sscanf(argv[3],"%30d",&codec) != 1) return RESULT_SHOWUSAGE; for (i = 0; i < 32; i++) Index: main/indications.c =================================================================== --- main/indications.c (revision 211527) +++ main/indications.c (revision 211528) @@ -236,46 +236,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 211527) +++ main/cli.c (revision 211528) @@ -319,7 +319,7 @@ if (argc > 5) return RESULT_SHOWUSAGE; - if (sscanf(argv[3], "%d", &newlevel) != 1) + if (sscanf(argv[3], "%30d", &newlevel) != 1) return RESULT_SHOWUSAGE; if (argc == 4) { @@ -334,7 +334,7 @@ if (argc < 5 || argc > 6) return RESULT_SHOWUSAGE; - if (sscanf(argv[4], "%d", &newlevel) != 1) + if (sscanf(argv[4], "%30d", &newlevel) != 1) return RESULT_SHOWUSAGE; if (argc == 5) { @@ -387,7 +387,7 @@ char *filename = ""; if ((argc < 3) || (argc > 4)) return RESULT_SHOWUSAGE; - if (sscanf(argv[2], "%d", &newlevel) != 1) + if (sscanf(argv[2], "%30d", &newlevel) != 1) return RESULT_SHOWUSAGE; option_debug = newlevel; if (argc == 4) { Index: main/pbx.c =================================================================== --- main/pbx.c (revision 211527) +++ main/pbx.c (revision 211528) @@ -1095,7 +1095,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 */ } } @@ -4069,7 +4069,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 */ @@ -4156,11 +4156,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; } @@ -5369,7 +5369,7 @@ struct ast_frame *f; int waittime; - if (ast_strlen_zero(data) || (sscanf(data, "%d", &waittime) != 1) || (waittime < 0)) + if (ast_strlen_zero(data) || (sscanf(data, "%30d", &waittime) != 1) || (waittime < 0)) waittime = -1; if (waittime > -1) { ast_safe_sleep(chan, waittime * 1000); @@ -6410,7 +6410,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 211527) +++ main/dnsmgr.c (revision 211528) @@ -380,7 +380,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_smdi.c =================================================================== --- res/res_smdi.c (revision 211527) +++ res/res_smdi.c (revision 211528) @@ -910,7 +910,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) { @@ -918,7 +918,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; } @@ -1052,7 +1052,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; } @@ -1173,7 +1173,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 211527) +++ res/res_agi.c (revision 211528) @@ -448,7 +448,7 @@ int to; 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); fdprintf(agi->fd, "200 result=%d\n", res); @@ -558,7 +558,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])) @@ -599,7 +599,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; fs = ast_openstream(chan, argv[2], chan->language); @@ -720,7 +720,7 @@ int num; 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_number_full(chan, num, argv[3], chan->language, (char *) NULL, agi->audio, agi->ctrl); if (res == 1) @@ -736,7 +736,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); @@ -766,7 +766,7 @@ int num; 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) @@ -781,7 +781,7 @@ int num; 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) @@ -892,7 +892,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; } @@ -924,7 +924,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) @@ -965,7 +965,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], '='))) @@ -1085,7 +1085,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; @@ -1259,7 +1259,7 @@ return RESULT_SHOWUSAGE; if (argv[2]) - sscanf(argv[2], "%d", &level); + sscanf(argv[2], "%30d", &level); switch (level) { case 4: Index: res/res_odbc.c =================================================================== --- res/res_odbc.c (revision 211527) +++ res/res_odbc.c (revision 211528) @@ -247,7 +247,7 @@ if (ast_true(v->value)) pooling = 1; } else if (!strcasecmp(v->name, "limit")) { - sscanf(v->value, "%d", &limit); + sscanf(v->value, "%4d", &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; @@ -261,7 +261,7 @@ limit = 1023; } } 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")) { @@ -610,7 +610,7 @@ if (!strcasecmp(v->name, "pooling")) { pooling = 1; } else if (!strcasecmp(v->name, "limit")) { - sscanf(v->value, "%d", &limit); + sscanf(v->value, "%4d", &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; @@ -620,7 +620,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_features.c =================================================================== --- res/res_features.c (revision 211527) +++ res/res_features.c (revision 211528) @@ -367,7 +367,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_log(LOG_WARNING, "PARKINGEXTEN does not indicate a valid parking slot: '%s'.\n", parkingexten); ast_mutex_unlock(&parking_lock); free(pu); @@ -2787,7 +2787,7 @@ } if (!ast_strlen_zero(timeout)) { - sscanf(timeout, "%d", &to); + sscanf(timeout, "%30d", &to); } res = ast_masq_park_call(ch1, ch2, to, &parkExt); @@ -2904,13 +2904,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; @@ -2959,18 +2959,18 @@ } 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 Index: codecs/codec_speex.c =================================================================== --- codecs/codec_speex.c (revision 211527) +++ codecs/codec_speex.c (revision 211528) @@ -402,7 +402,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) { if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting VBR Quality to %f\n",res_f); vbr_quality = res_f; @@ -451,7 +451,7 @@ if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_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) { if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f); pp_agc_level = res_f; @@ -466,14 +466,14 @@ if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_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) { if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_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) { if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f); pp_dereverb_level = res_f; Index: utils/muted.c =================================================================== --- utils/muted.c (revision 211527) +++ utils/muted.c (revision 211528) @@ -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 211527) +++ utils/frame.c (revision 211528) @@ -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: Property changes on: . ___________________________________________________________________ Modified: branch-1.2-merged - /branches/1.2:1-7489,7491-7496,7498-7516,7518-7528,7530-7545,7547-7549,7551,7553-7556,7558-7579,7581-7585,7587-7594,7596-7604,7606-7640,7642-7662,7664-7705,7707-7737,7739-7770,7772-7791,7793-7811,7813-7869,7872-7897,7901-7914,7916-7959,7961-7964,7966-7969,7971-7975,7977-8046,8048-8111,8113-8123,8125-8133,8135-8393,8395-8411,8413,8415-8417,8419-8428,8430-8432,8434-8444,8446-8561,8563-8572,8574-8599,8601-8618,8620-8665,8667-8807,8809-9072,9074-9261,9263-9322,9324-9325,9327-9606,9608-9755,9757-9817,9819-9860,9862-9869,9871-9952,9954-10109,10111-10862,10864-10951,10953-11089,11165,11250,11382,11408,11410,11479,11503,11528,11530,11561,11607,11609,11634-11635,11659,11715,11778,11946,12036,12161,12195,12458,12477,12495,12577,12792,12925,12927,13026,13095,13197,13237,13239,13279,13547,13550,13634,13707,13748,13814,13851,13888,13961,13964,14140,14191,14234,14275-14276,14462,14467,14523,14659,14704,14821,14830,14868,15366,15376,15381,15615,15658,15699,15703,15896,15898,16082,16192,16303,16346,16534,16579,16581,16742,16744,17074,17147,17150,17283,17335,17489,17702,17905,18087-18089,18250,18260,18436,18494,18866,19008,19301,19303,19345,19347-19348,19351,19353,19394,19397,19812,19891,20034,20037,20966,21037,21597,21638,22596,23305,23580,23636,23638,23673,23705,23985,23988,24019,24097,24381,24496,24567,24669,24706,24837,25123,25288,25322,25518,25520,25563,25608,26050,26760,27051,27093,27468,27636,27847,27927,27973,28125,28169,28212,28337,28380-28384,28627,28651,28698,28754,28790,28794,28896,28968,29196,29398,29464,29512,29555,29696,29764,29849,29969,29971,29973,30033,30037,30239,30293,30296,30373,30424,30802,30874,31161,31194,31321,31520,31555,31738,31921,32373,32566,32582,32605,32818,33036,33235,33294,33297,33466,33480,33510,33513,33515,33548,33615,33638,33693,33724,33753,33781,33813,33841,33993,34087,34159-34160,34242,34274,34400,34627,34875,34911,35121,35334,35669,35915,36078,36253-36254,36290,36377,36697,36911,36998,37143,37173,37212,37307,37361,37402,37417,37419,37439,37441-37442,37458,37516,37531,37571,37612,37691,37765,37856,37949,38200,38234,38288,38310,38328,38347,38420,38546-38547,38611,38654,38686,38731,38761,38825,38903-38904,38928,38950,38972,38982,39056,39081,39379,39935,40057,40225,40227,40392,40692,40798,40901,40971,40979,40994,41269,41334,41390,41423,41690,41768,41827,41882,41989,42014,42086,42133,42148,42260,42355,42421,42452,42535,42600,42697,42716,42783,42946,43003,43019,43072,43159,43220,43248,43314,43409,43420,43552,43634,43699,43705,43708,43764,43778,43815,43871,43891,43895,43897,43916,44110,44168,44198,44213,44296,44334-44335,44392,44432,44460,44501,44580,44785,44955,44993,45020,45030,45048,45060,45119,45260,45265,45306,45326,45691,45808,45927,46176,46337,46350,46402,46406,46430,46557,46560,46604,46610,46776,46876,46899,46920,46964,47238,47248,47307,47379,47452,47458,47496,47522,47525,47549,47571,47580,47583,47596,47631,47655,47677,47682,47686-47689,47711,47743,47750,47776,47842,47859,47862,47958,47968,47987,48037,48045,48053,48087,48106,48142,48151,48154,48157,48165,48183,48192,48251,48315,48319-48360,48362-48397,48399-48402,48404-48433,48435-48973,48975-49303,49354,49412,49447,49635,49833,49889,50150,50227,50295,50495-50506,50561,50781,50946,51085,51145,51158,51161,51194,51197,51235,51255,51271,51406,51512,51828,51843,51966,52002,52162,52264,52360,52415,52716,52762,52843,52903,53039,53045,53069,53074,53084,53095,53103,53117,53133,53245,53354,53357,53529,54373,54622,54771,54955,54999,55005,55073,55153,55277,55434,55669,55868,55956,56010,56230,56406,56504,56684,56850,57034-57961,57963-58007,58009-58166,58168-58558,58579,58847,58849-59063,59086,59186,59194,59252,59258,59277,59280,59283,59301,59357,59360,59608,59623-59639,59723,59788-59803,59886,59916,59938,60083,60134,60213,60267,60398,60456,60660,60711,60797,60846,60849,60935,61038,61170,61357-61662,61664-61775,61777-62885,62945-63194,63196-63519,63565,63610,63653,63748,63828,63903,64275,64514,64535,64758,64819,64902,65007,65075,65122,65172,65328,65389,65588,65676,65682,65767,65837,66127,66349,66537,66744,66764,67060,67161,67209,67306-67307,67593,67649,67715,67938,68070,68204,68351,68368,68397,68526,68631,68682,68732,68874,68887,68921,69053,69127,69258,69469,69743,69765,69846,69887,69894,69986,69992,70053,70311,70341-70342,70396,70444,70551,70672,70804,70898,70948,71064-71065,71288,71358,71414,71656,71750,72040-72041,72087,72099,72256,72259,72267,72327,72333,72373,72378,72585,72805,73004,73052,73207,73252,73315,73318,73349,73466,73547,73674,73678,73684,73768,74158,74264,74313,74316,74373,74376,74427,74656,74719,74766,74814,75052,75059,75066,75107,75304,75440,75444,75449,75657,75748,75757,75927,76080,76226,76560,76653,76934,76978,77767,77782,77842,77942,78370,82334,93667,94255,96931,109391,110335,110869,111019,111125,114822,115421,115511,115564,119008,119237,132711,133577,136945,159245,161421,167259,170580,186056,206384 + /branches/1.2:1-7489,7491-7496,7498-7516,7518-7528,7530-7545,7547-7549,7551,7553-7556,7558-7579,7581-7585,7587-7594,7596-7604,7606-7640,7642-7662,7664-7705,7707-7737,7739-7770,7772-7791,7793-7811,7813-7869,7872-7897,7901-7914,7916-7959,7961-7964,7966-7969,7971-7975,7977-8046,8048-8111,8113-8123,8125-8133,8135-8393,8395-8411,8413,8415-8417,8419-8428,8430-8432,8434-8444,8446-8561,8563-8572,8574-8599,8601-8618,8620-8665,8667-8807,8809-9072,9074-9261,9263-9322,9324-9325,9327-9606,9608-9755,9757-9817,9819-9860,9862-9869,9871-9952,9954-10109,10111-10862,10864-10951,10953-11089,11165,11250,11382,11408,11410,11479,11503,11528,11530,11561,11607,11609,11634-11635,11659,11715,11778,11946,12036,12161,12195,12458,12477,12495,12577,12792,12925,12927,13026,13095,13197,13237,13239,13279,13547,13550,13634,13707,13748,13814,13851,13888,13961,13964,14140,14191,14234,14275-14276,14462,14467,14523,14659,14704,14821,14830,14868,15366,15376,15381,15615,15658,15699,15703,15896,15898,16082,16192,16303,16346,16534,16579,16581,16742,16744,17074,17147,17150,17283,17335,17489,17702,17905,18087-18089,18250,18260,18436,18494,18866,19008,19301,19303,19345,19347-19348,19351,19353,19394,19397,19812,19891,20034,20037,20966,21037,21597,21638,22596,23305,23580,23636,23638,23673,23705,23985,23988,24019,24097,24381,24496,24567,24669,24706,24837,25123,25288,25322,25518,25520,25563,25608,26050,26760,27051,27093,27468,27636,27847,27927,27973,28125,28169,28212,28337,28380-28384,28627,28651,28698,28754,28790,28794,28896,28968,29196,29398,29464,29512,29555,29696,29764,29849,29969,29971,29973,30033,30037,30239,30293,30296,30373,30424,30802,30874,31161,31194,31321,31520,31555,31738,31921,32373,32566,32582,32605,32818,33036,33235,33294,33297,33466,33480,33510,33513,33515,33548,33615,33638,33693,33724,33753,33781,33813,33841,33993,34087,34159-34160,34242,34274,34400,34627,34875,34911,35121,35334,35669,35915,36078,36253-36254,36290,36377,36697,36911,36998,37143,37173,37212,37307,37361,37402,37417,37419,37439,37441-37442,37458,37516,37531,37571,37612,37691,37765,37856,37949,38200,38234,38288,38310,38328,38347,38420,38546-38547,38611,38654,38686,38731,38761,38825,38903-38904,38928,38950,38972,38982,39056,39081,39379,39935,40057,40225,40227,40392,40692,40798,40901,40971,40979,40994,41269,41334,41390,41423,41690,41768,41827,41882,41989,42014,42086,42133,42148,42260,42355,42421,42452,42535,42600,42697,42716,42783,42946,43003,43019,43072,43159,43220,43248,43314,43409,43420,43552,43634,43699,43705,43708,43764,43778,43815,43871,43891,43895,43897,43916,44110,44168,44198,44213,44296,44334-44335,44392,44432,44460,44501,44580,44785,44955,44993,45020,45030,45048,45060,45119,45260,45265,45306,45326,45691,45808,45927,46176,46337,46350,46402,46406,46430,46557,46560,46604,46610,46776,46876,46899,46920,46964,47238,47248,47307,47379,47452,47458,47496,47522,47525,47549,47571,47580,47583,47596,47631,47655,47677,47682,47686-47689,47711,47743,47750,47776,47842,47859,47862,47958,47968,47987,48037,48045,48053,48087,48106,48142,48151,48154,48157,48165,48183,48192,48251,48315,48319-48360,48362-48397,48399-48402,48404-48433,48435-48973,48975-49303,49354,49412,49447,49635,49833,49889,50150,50227,50295,50495-50506,50561,50781,50946,51085,51145,51158,51161,51194,51197,51235,51255,51271,51406,51512,51828,51843,51966,52002,52162,52264,52360,52415,52716,52762,52843,52903,53039,53045,53069,53074,53084,53095,53103,53117,53133,53245,53354,53357,53529,54373,54622,54771,54955,54999,55005,55073,55153,55277,55434,55669,55868,55956,56010,56230,56406,56504,56684,56850,57034-57961,57963-58007,58009-58166,58168-58558,58579,58847,58849-59063,59086,59186,59194,59252,59258,59277,59280,59283,59301,59357,59360,59608,59623-59639,59723,59788-59803,59886,59916,59938,60083,60134,60213,60267,60398,60456,60660,60711,60797,60846,60849,60935,61038,61170,61357-61662,61664-61775,61777-62885,62945-63194,63196-63519,63565,63610,63653,63748,63828,63903,64275,64514,64535,64758,64819,64902,65007,65075,65122,65172,65328,65389,65588,65676,65682,65767,65837,66127,66349,66537,66744,66764,67060,67161,67209,67306-67307,67593,67649,67715,67938,68070,68204,68351,68368,68397,68526,68631,68682,68732,68874,68887,68921,69053,69127,69258,69469,69743,69765,69846,69887,69894,69986,69992,70053,70311,70341-70342,70396,70444,70551,70672,70804,70898,70948,71064-71065,71288,71358,71414,71656,71750,72040-72041,72087,72099,72256,72259,72267,72327,72333,72373,72378,72585,72805,73004,73052,73207,73252,73315,73318,73349,73466,73547,73674,73678,73684,73768,74158,74264,74313,74316,74373,74376,74427,74656,74719,74766,74814,75052,75059,75066,75107,75304,75440,75444,75449,75657,75748,75757,75927,76080,76226,76560,76653,76934,76978,77767,77782,77842,77942,78370,82334,93667,94255,96931,109391,110335,110869,111019,111125,114822,115421,115511,115564,119008,119237,132711,133577,136945,159245,161421,167259,170580,186056,206384,211526