Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/opus-tools-0.1.10/src/arch.h
Examining data/opus-tools-0.1.10/src/audio-in.c
Examining data/opus-tools-0.1.10/src/cpusupport.h
Examining data/opus-tools-0.1.10/src/diag_range.c
Examining data/opus-tools-0.1.10/src/diag_range.h
Examining data/opus-tools-0.1.10/src/flac.c
Examining data/opus-tools-0.1.10/src/flac.h
Examining data/opus-tools-0.1.10/src/info_opus.c
Examining data/opus-tools-0.1.10/src/info_opus.h
Examining data/opus-tools-0.1.10/src/lpc.c
Examining data/opus-tools-0.1.10/src/lpc.h
Examining data/opus-tools-0.1.10/src/opus_header.c
Examining data/opus-tools-0.1.10/src/opus_header.h
Examining data/opus-tools-0.1.10/src/opusdec.c
Examining data/opus-tools-0.1.10/src/opusenc.c
Examining data/opus-tools-0.1.10/src/opusenc.h
Examining data/opus-tools-0.1.10/src/opusinfo.c
Examining data/opus-tools-0.1.10/src/opusinfo.h
Examining data/opus-tools-0.1.10/src/opusrtp.c
Examining data/opus-tools-0.1.10/src/os_support.h
Examining data/opus-tools-0.1.10/src/picture.c
Examining data/opus-tools-0.1.10/src/picture.h
Examining data/opus-tools-0.1.10/src/resample.c
Examining data/opus-tools-0.1.10/src/resample_sse.h
Examining data/opus-tools-0.1.10/src/speex_resampler.h
Examining data/opus-tools-0.1.10/src/stack_alloc.h
Examining data/opus-tools-0.1.10/src/wav_io.c
Examining data/opus-tools-0.1.10/src/wav_io.h
Examining data/opus-tools-0.1.10/src/wave_out.c
Examining data/opus-tools-0.1.10/src/wave_out.h
Examining data/opus-tools-0.1.10/win32/unicode_support.c
Examining data/opus-tools-0.1.10/win32/unicode_support.h

FINAL RESULTS:

data/opus-tools-0.1.10/src/opusenc.c:46:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define snprintf _snprintf
data/opus-tools-0.1.10/src/opusenc.c:46:18:  [4] (format) _snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define snprintf _snprintf
data/opus-tools-0.1.10/src/opusinfo.c:73:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, format, ap);
data/opus-tools-0.1.10/src/opusinfo.c:86:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, format, ap);
data/opus-tools-0.1.10/src/opusinfo.c:97:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, format, ap);
data/opus-tools-0.1.10/src/opusdec.c:716:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
      c = getopt_long (argc_utf8, argv_utf8, "hV",
data/opus-tools-0.1.10/src/opusenc.c:381:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(((getpid()&65535)<<15)^start_time);
data/opus-tools-0.1.10/src/opusenc.c:396:7:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    c=getopt_long(argc_utf8, argv_utf8, "hV",
data/opus-tools-0.1.10/src/opusinfo.c:975:18:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while((ret = getopt(argc_utf8, argv_utf8, "hqvV")) >= 0) {
data/opus-tools-0.1.10/src/opusrtp.c:979:20:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((option = getopt_long(argc, argv, "hVqd:p:", long_options, &i)) != -1) {
data/opus-tools-0.1.10/src/wave_out.c:80:3:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
		EnterCriticalSection ( &cs );
data/opus-tools-0.1.10/src/wave_out.c:93:2:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
	EnterCriticalSection ( &cs );
data/opus-tools-0.1.10/src/wave_out.c:144:2:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
	InitializeCriticalSection ( &cs );
data/opus-tools-0.1.10/src/wave_out.c:192:2:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
	EnterCriticalSection ( &cs );
data/opus-tools-0.1.10/src/audio-in.c:184:22:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            unsigned char buf[1024];
data/opus-tools-0.1.10/src/audio-in.c:201:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buf[8];
data/opus-tools-0.1.10/src/audio-in.c:230:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buf[8];
data/opus-tools-0.1.10/src/audio-in.c:328:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buffer[22];
data/opus-tools-0.1.10/src/audio-in.c:329:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buf2[8];
data/opus-tools-0.1.10/src/audio-in.c:447:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(aiff->channel_permute, aiff_permute_matrix[aiff->channels-1],
data/opus-tools-0.1.10/src/audio-in.c:482:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buf[40];
data/opus-tools-0.1.10/src/audio-in.c:700:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(wav->channel_permute, wav_permute_matrix[wav->channels-1],
data/opus-tools-0.1.10/src/audio-in.c:787:35:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                      (((unsigned char *)buf)[i*3*f->channels + 3*ch_permute[j] + 1] << 8) |
data/opus-tools-0.1.10/src/audio-in.c:788:35:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                      (((unsigned char *)buf)[i*3*f->channels + 3*ch_permute[j]] & 0xff))
data/opus-tools-0.1.10/src/audio-in.c:930:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(buffer+in_samples*d->channels,d->lpc_out+d->lpc_ptr*d->channels,extra*d->channels*sizeof(*buffer));
data/opus-tools-0.1.10/src/diag_range.c:72:50:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
data/opus-tools-0.1.10/src/diag_range.c:73:36:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      int self_delimited, unsigned char *out_toc,
data/opus-tools-0.1.10/src/diag_range.c:74:22:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      const unsigned char *frames[48], short size[48], int *payload_offset)
data/opus-tools-0.1.10/src/diag_range.c:222:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static const char *bw_strings[5]={"NB","MB","WB","SWB","FB"};
data/opus-tools-0.1.10/src/diag_range.c:223:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static const char *mode_strings[3]={"LP","HYB","MDCT"};
data/opus-tools-0.1.10/src/diag_range.c:229:20:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    const unsigned char *frames[48];
data/opus-tools-0.1.10/src/flac.c:56:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(buffer,flac->oldbuf,bytes_to_copy);
data/opus-tools-0.1.10/src/flac.c:127:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
          entry=(char *)comments[i].entry;
data/opus-tools-0.1.10/src/flac.c:182:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
          char track_gain_buf[7];
data/opus-tools-0.1.10/src/flac.c:186:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(track_gain_buf,"%i",track_gain_val);
data/opus-tools-0.1.10/src/flac.c:212:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf+offs,metadata->data.picture.mime_type,mime_type_length);
data/opus-tools-0.1.10/src/flac.c:216:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf+offs,metadata->data.picture.description,description_length);
data/opus-tools-0.1.10/src/flac.c:228:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf+offs,metadata->data.picture.data,
data/opus-tools-0.1.10/src/flac.c:348:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(buffer,block_buf+block_buf_pos*channels,
data/opus-tools-0.1.10/src/flac.c:373:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(flac->oldbuf,oldbuf,buflen*sizeof(*flac->oldbuf));
data/opus-tools-0.1.10/src/info_opus.c:144:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(tmp,c,len);
data/opus-tools-0.1.10/src/info_opus.c:172:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy(comment,c,len);
data/opus-tools-0.1.10/src/opus_header.c:139:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char str[9];
data/opus-tools-0.1.10/src/opus_header.h:43:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char stream_map[255];
data/opus-tools-0.1.10/src/opusdec.c:58:28:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
# define fopen_utf8(_x,_y) fopen((_x),(_y))
data/opus-tools-0.1.10/src/opusdec.c:315:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      audio_fd=open("/dev/dsp", O_WRONLY);
data/opus-tools-0.1.10/src/opusdec.c:373:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      audio_fd = open("/dev/audio", O_WRONLY);
data/opus-tools-0.1.10/src/opusdec.c:750:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            rate=atoi (optarg);
data/opus-tools-0.1.10/src/opusenc.c:57:28:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
# define fopen_utf8(_x,_y) fopen((_x),(_y))
data/opus-tools-0.1.10/src/opusenc.c:313:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char               ENCODER_string[1024];
data/opus-tools-0.1.10/src/opusenc.c:435:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          inopt.samplesize=atoi(optarg);
data/opus-tools-0.1.10/src/opusenc.c:444:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          inopt.rate=atoi(optarg);
data/opus-tools-0.1.10/src/opusenc.c:448:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          inopt.channels=atoi(optarg);
data/opus-tools-0.1.10/src/opusenc.c:452:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          inopt.endianness=atoi(optarg);
data/opus-tools-0.1.10/src/opusenc.c:461:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          expect_loss=atoi(optarg);
data/opus-tools-0.1.10/src/opusenc.c:469:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          complexity=atoi(optarg);
data/opus-tools-0.1.10/src/opusenc.c:495:20:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          serialno=atoi(optarg);
data/opus-tools-0.1.10/src/opusenc.c:510:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          }else target=atoi(optarg);
data/opus-tools-0.1.10/src/opusenc.c:511:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          if((atoi(tpos+1)&1)!=0){
data/opus-tools-0.1.10/src/opusenc.c:524:41:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          opt_ctls_ctlval[opt_ctls*3+1]=atoi(tpos+1);
data/opus-tools-0.1.10/src/opusenc.c:525:41:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          opt_ctls_ctlval[opt_ctls*3+2]=atoi(spos+1);
data/opus-tools-0.1.10/src/opusenc.c:574:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          comment_padding=atoi(optarg);
data/opus-tools-0.1.10/src/opusenc.c:853:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char header_data[276];
data/opus-tools-0.1.10/src/opusenc.c:1035:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char sbuf[55];
data/opus-tools-0.1.10/src/opusenc.c:1151:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p, "OpusTags", 8);
data/opus-tools-0.1.10/src/opusenc.c:1153:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p+12, vendor_string, vendor_length);
data/opus-tools-0.1.10/src/opusenc.c:1176:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p+*length+4, tag, tag_len);        /* comment tag */
data/opus-tools-0.1.10/src/opusenc.c:1179:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p+*length+4+tag_len, val, val_len);  /* comment */
data/opus-tools-0.1.10/src/opusinfo.c:38:28:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
# define fopen_utf8(_x,_y) fopen((_x),(_y))
data/opus-tools-0.1.10/src/opusrtp.c:121:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(data, "OpusHead", 8);  /* identifier */
data/opus-tools-0.1.10/src/opusrtp.c:160:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(data, identifier, 8);
data/opus-tools-0.1.10/src/opusrtp.c:162:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(data + 12, vendor, strlen(vendor));
data/opus-tools-0.1.10/src/opusrtp.c:284:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char src[6], dst[6]; /* ethernet MACs */
data/opus-tools-0.1.10/src/opusrtp.c:297:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char src[4], dst[4]; /* ipv4 addrs */
data/opus-tools-0.1.10/src/opusrtp.c:339:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&d, p, 4);
data/opus-tools-0.1.10/src/opusrtp.c:352:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(eth->src, packet + 0, 6);
data/opus-tools-0.1.10/src/opusrtp.c:353:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(eth->dst, packet + 6, 6);
data/opus-tools-0.1.10/src/opusrtp.c:394:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(ip->src, packet + 12, 4);
data/opus-tools-0.1.10/src/opusrtp.c:395:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(ip->dst, packet + 16, 4);
data/opus-tools-0.1.10/src/opusrtp.c:506:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(packet + rtp->header_size, opus, rtp->payload_size);
data/opus-tools-0.1.10/src/opusrtp.c:556:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE *in = fopen(filename, "rb");
data/opus-tools-0.1.10/src/opusrtp.c:794:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char errbuf[PCAP_ERRBUF_SIZE];
data/opus-tools-0.1.10/src/opusrtp.c:824:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  params->out = fopen("rtpdump.opus", "wb");
data/opus-tools-0.1.10/src/opusrtp.c:865:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char errbuf[PCAP_ERRBUF_SIZE];
data/opus-tools-0.1.10/src/opusrtp.c:899:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  params->out = fopen("rtpdump.opus", "wb");
data/opus-tools-0.1.10/src/opusrtp.c:1016:20:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            port = atoi(optarg);
data/opus-tools-0.1.10/src/os_support.h:93:34:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define SPEEX_COPY(dst, src, n) (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
data/opus-tools-0.1.10/src/picture.c:37:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char BASE64_TABLE[64]={
data/opus-tools-0.1.10/src/picture.c:268:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  picture_file=fopen(filename,"rb");
data/opus-tools-0.1.10/src/picture.c:335:29:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if(!is_url)picture_file=fopen(filename,"rb");
data/opus-tools-0.1.10/src/picture.c:349:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(buf+data_offset,filename,data_length);
data/opus-tools-0.1.10/src/picture.c:481:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(buf+data_offset,description,description_end-description);
data/opus-tools-0.1.10/src/picture.c:485:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(buf+data_offset,mime_type,mime_type_end-mime_type);
data/opus-tools-0.1.10/src/wav_io.c:42:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char new_stream_map[8];
data/opus-tools-0.1.10/src/wav_io.c:52:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(stream_map, new_stream_map, channels*sizeof(*stream_map));
data/opus-tools-0.1.10/src/wav_io.c:57:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char buf[4];
data/opus-tools-0.1.10/src/wav_io.c:67:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char buf[2];
data/opus-tools-0.1.10/src/wav_io.c:99:29:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      static const unsigned char ksdataformat_subtype_pcm[16]=
data/opus-tools-0.1.10/src/wav_io.c:107:29:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      static const unsigned char ksdataformat_subtype_float[16]=
data/opus-tools-0.1.10/src/wave_out.c:171:2:  [2] (buffer) CopyMemory:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	CopyMemory ( allocptr, data, len );                         // Here we can call any modification output functions we want....
data/opus-tools-0.1.10/win32/unicode_support.c:74:13:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
	BuffSize = MultiByteToWideChar(CP_UTF8, 0, input, -1, NULL, 0);
data/opus-tools-0.1.10/win32/unicode_support.c:78:12:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
		Result = MultiByteToWideChar(CP_UTF8, 0, input, -1, Buffer, BuffSize);
data/opus-tools-0.1.10/src/flac.c:202:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        mime_type_length=strlen(metadata->data.picture.mime_type);
data/opus-tools-0.1.10/src/flac.c:203:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        description_length=strlen((char *)metadata->data.picture.description);
data/opus-tools-0.1.10/src/opusdec.c:285:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (strlen(outFile)==0)
data/opus-tools-0.1.10/src/opusdec.c:795:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
     i=strlen(outFile)-4;
data/opus-tools-0.1.10/src/opusdec.c:1055:113:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               outsamp=audio_write(output, channels, frame_size, fout, resampler, &preskip, dither?&shapemem:0, strlen(outFile)!=0,0>maxout?0:maxout,fp);
data/opus-tools-0.1.10/src/opusdec.c:1079:92:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               outsamp=audio_write(zeros, channels, tmp, fout, resampler, NULL, &shapemem, strlen(outFile)!=0, ((page_granule-gran_offset)*rate/48000)-link_out,fp);
data/opus-tools-0.1.10/src/opusdec.c:1105:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (strlen(outFile)!=0 && fout && wav_format>0 && audio_size<0x7FFFFFFF)
data/opus-tools-0.1.10/src/opusdec.c:1133:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (strlen(outFile)==0)
data/opus-tools-0.1.10/src/opusenc.c:497:19:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          int len=strlen(optarg),target;
data/opus-tools-0.1.10/src/opusenc.c:1050:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        last_spin_len=strlen(sbuf);
data/opus-tools-0.1.10/src/opusenc.c:1059:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        last_spin_len=strlen(sbuf);
data/opus-tools-0.1.10/src/opusenc.c:1143:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int vendor_length=strlen(vendor_string);
data/opus-tools-0.1.10/src/opusenc.c:1164:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int tag_len=(tag?strlen(tag)+1:0);
data/opus-tools-0.1.10/src/opusenc.c:1165:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int val_len=strlen(val);
data/opus-tools-0.1.10/src/opusrtp.c:145:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int size = strlen(identifier) + 4 + strlen(vendor) + 4;
data/opus-tools-0.1.10/src/opusrtp.c:145:39:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int size = strlen(identifier) + 4 + strlen(vendor) + 4;
data/opus-tools-0.1.10/src/opusrtp.c:161:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  le32(data + 8, strlen(vendor));
data/opus-tools-0.1.10/src/opusrtp.c:162:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  memcpy(data + 12, vendor, strlen(vendor));
data/opus-tools-0.1.10/src/opusrtp.c:163:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  le32(data + 12 + strlen(vendor), 0);
data/opus-tools-0.1.10/src/opusrtp.c:639:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(samples*1000/48);
data/opus-tools-0.1.10/src/picture.c:346:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    data_length=strlen(filename);

ANALYSIS SUMMARY:

Hits = 123
Lines analyzed = 10895 in approximately 0.35 seconds (31566 lines/second)
Physical Source Lines of Code (SLOC) = 8168
Hits@level = [0] 452 [1]  21 [2]  88 [3]   9 [4]   5 [5]   0
Hits@level+ = [0+] 575 [1+] 123 [2+] 102 [3+]  14 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 70.3967 [1+] 15.0588 [2+] 12.4878 [3+] 1.71401 [4+] 0.612145 [5+]   0
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.