~damg/ubuntu/quantal/asterisk/LP1097687

« back to all changes in this revision

Viewing changes to apps/app_rpt.c

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2009-09-22 16:22:14 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090922162214-awce8id0lt9v51jb
Tags: 1:1.6.2.0~rc2-0ubuntu1

* New upstream version, upstream is now DFSG compliant.
  - ilibc has been removed upstream.
  - Music on Hold is now cc-by-sa.
  - binary firmware iaxy.bin has been removed upstream.
* debian/rules: Santitised UPSTREAM variable for compatiability
  with Ubuntu and other variants.
* debian/control: Removed Debian Vcs-Svn entry and replaced 
  with ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
* patches/makefile_appdocs_dtd: Removed, merged upstream.
* patches/disable_moh: Previosly disabled, removed from pool.
* patches/ubuntu-banner: Ported debian-banner to display Ubuntu
  centric bug report information.
* Refresh quilt patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
314
314
 
315
315
#include "asterisk.h"
316
316
 
317
 
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 209063 $")
 
317
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 211580 $")
318
318
 
319
319
#include <signal.h>
320
320
#include <stdio.h>
2101
2101
 
2102
2102
        if (str == NULL) return -1;
2103
2103
        /* leave this %i alone, non-base-10 input is useful here */
2104
 
        if (sscanf(str,"%i",&ret) != 1) return -1;
 
2104
        if (sscanf(str, "%30i", &ret) != 1) {
 
2105
                return -1;
 
2106
        }
 
2107
 
2105
2108
        return ret;
2106
2109
}
2107
2110
 
2325
2328
        /* do not use atoi() here, we need to be able to have
2326
2329
                the input specified in hex or decimal so we use
2327
2330
                sscanf with a %i */
2328
 
        if ((!val) || (sscanf(val,"%i",&rpt_vars[n].p.iobase) != 1))
 
2331
        if ((!val) || (sscanf(val,"%30i",&rpt_vars[n].p.iobase) != 1))
2329
2332
                rpt_vars[n].p.iobase = DEFAULT_IOBASE;
2330
2333
        val = (char *) ast_variable_retrieve(cfg,this,"ioport");
2331
2334
        rpt_vars[n].p.ioport = val;
3640
3643
                tonesubset = strsep(&stringp,")");
3641
3644
                if(!tonesubset)
3642
3645
                        break;
3643
 
                if(sscanf(tonesubset,"(%d,%d,%d,%d", &f1, &f2, &duration, &amplitude) != 4)
 
3646
                if(sscanf(tonesubset,"(%30d,%30d,%30d,%30d", &f1, &f2, &duration, &amplitude) != 4)
3644
3647
                        break;
3645
3648
                res = play_tone_pair(chan, f1, f2, duration, amplitude);
3646
3649
                if(res)
5065
5068
                p = strstr(tdesc, "version");   
5066
5069
                if(!p)
5067
5070
                        break;  
5068
 
                if(sscanf(p, "version %d.%d", &vmajor, &vminor) != 2)
 
5071
                if(sscanf(p, "version %30d.%30d", &vmajor, &vminor) != 2)
5069
5072
                        break;
5070
5073
                wait_interval(myrpt, DLY_TELEM, mychannel); /* Wait a little bit */
5071
5074
                /* Say "version" */
6673
6676
static void handle_link_data(struct rpt *myrpt, struct rpt_link *mylink,
6674
6677
        char *str)
6675
6678
{
 
6679
/* XXX ATTENTION: if you change the size of these arrays you MUST
 
6680
 * change the limits in corresponding sscanf() calls below. */
6676
6681
char    tmp[512],tmp1[512],cmd[300] = "",dest[300],src[300],c;
6677
6682
int     i,seq, res, ts;
6678
6683
struct rpt_link *l;
6711
6716
        }
6712
6717
        if (tmp[0] == 'K')
6713
6718
        {
6714
 
                if (sscanf(tmp,"%s %s %s %d %d",cmd,dest,src,&seq,&ts) != 5)
 
6719
                if (sscanf(tmp, "%299s %299s %299s %30d %30d", cmd, dest, src, &seq, &ts) != 5)
6715
6720
                {
6716
6721
                        ast_log(LOG_WARNING, "Unable to parse keying string %s\n",str);
6717
6722
                        return;
6819
6824
        }
6820
6825
        if (tmp[0] == 'I')
6821
6826
        {
6822
 
                if (sscanf(tmp,"%s %s %x",cmd,src,&seq) != 3)
 
6827
                /* XXX WARNING: be very careful with the limits on the folowing
 
6828
                 * sscanf() call, make sure they match the values defined above */
 
6829
                if (sscanf(tmp,"%299s %299s %30x",cmd,src,&seq) != 3)
6823
6830
                {
6824
6831
                        ast_log(LOG_WARNING, "Unable to parse ident string %s\n",str);
6825
6832
                        return;
6829
6836
        }
6830
6837
        else
6831
6838
        {
6832
 
                if (sscanf(tmp,"%s %s %s %d %c",cmd,dest,src,&seq,&c) != 5)
 
6839
                /* XXX WARNING: be very careful with the limits on the folowing
 
6840
                 * sscanf() call, make sure they match the values defined above */
 
6841
                if (sscanf(tmp,"%299s %299s %299s %30d %1c",cmd,dest,src,&seq,&c) != 5)
6833
6842
                {
6834
6843
                        ast_log(LOG_WARNING, "Unable to parse link string %s\n",str);
6835
6844
                        return;
10224
10233
 
10225
10234
static int handle_remote_data(struct rpt *myrpt, char *str)
10226
10235
{
 
10236
/* XXX ATTENTION: if you change the size of these arrays you MUST
 
10237
 * change the limits in corresponding sscanf() calls below. */
10227
10238
char    tmp[300],cmd[300],dest[300],src[300],c;
10228
10239
int     seq,res;
10229
10240
 
10239
10250
#ifndef DO_NOT_NOTIFY_MDC1200_ON_REMOTE_BASES
10240
10251
        if (tmp[0] == 'I')
10241
10252
        {
10242
 
                if (sscanf(tmp,"%s %s %x",cmd,src,&seq) != 3)
 
10253
                /* XXX WARNING: be very careful with the limits on the folowing
 
10254
                 * sscanf() call, make sure they match the values defined above */
 
10255
                if (sscanf(tmp,"%299s %299s %30x",cmd,src,&seq) != 3)
10243
10256
                {
10244
10257
                        ast_log(LOG_WARNING, "Unable to parse ident string %s\n",str);
10245
10258
                        return 0;
10248
10261
                return 0;
10249
10262
        }
10250
10263
#endif
10251
 
        if (sscanf(tmp,"%s %s %s %d %c",cmd,dest,src,&seq,&c) != 5)
 
10264
        /* XXX WARNING: be very careful with the limits on the folowing
 
10265
         * sscanf() call, make sure they match the values defined above */
 
10266
        if (sscanf(tmp,"%299s %299s %299s %30d %1c",cmd,dest,src,&seq,&c) != 5)
10252
10267
        {
10253
10268
                ast_log(LOG_WARNING, "Unable to parse link string %s\n",str);
10254
10269
                return 0;
11879
11894
                        p = strstr(tdesc, "version");
11880
11895
                        if(p){
11881
11896
                                int vmajor,vminor;
11882
 
                                if(sscanf(p, "version %d.%d", &vmajor, &vminor) == 2)
 
11897
                                if(sscanf(p, "version %30d.%30d", &vmajor, &vminor) == 2)
11883
11898
                                        sprintf(str + strlen(str),"&apprptvers=%d.%d",vmajor,vminor);
11884
11899
                        }
11885
11900
                        time(&now);