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/libdca-0.0.7/include/audio_out.h
Examining data/libdca-0.0.7/include/dca.h
Examining data/libdca-0.0.7/include/dts.h
Examining data/libdca-0.0.7/include/tendra.h
Examining data/libdca-0.0.7/libao/audio_out.c
Examining data/libdca-0.0.7/libao/audio_out_aif.c
Examining data/libdca-0.0.7/libao/audio_out_al.c
Examining data/libdca-0.0.7/libao/audio_out_float.c
Examining data/libdca-0.0.7/libao/audio_out_internal.h
Examining data/libdca-0.0.7/libao/audio_out_null.c
Examining data/libdca-0.0.7/libao/audio_out_oss.c
Examining data/libdca-0.0.7/libao/audio_out_peak.c
Examining data/libdca-0.0.7/libao/audio_out_solaris.c
Examining data/libdca-0.0.7/libao/audio_out_wav.c
Examining data/libdca-0.0.7/libao/audio_out_win.c
Examining data/libdca-0.0.7/libao/convert2s16.c
Examining data/libdca-0.0.7/libdca/bitstream.c
Examining data/libdca-0.0.7/libdca/bitstream.h
Examining data/libdca-0.0.7/libdca/dca_internal.h
Examining data/libdca-0.0.7/libdca/downmix.c
Examining data/libdca-0.0.7/libdca/parse.c
Examining data/libdca-0.0.7/libdca/tables.h
Examining data/libdca-0.0.7/libdca/tables_adpcm.h
Examining data/libdca-0.0.7/libdca/tables_fir.h
Examining data/libdca-0.0.7/libdca/tables_huffman.h
Examining data/libdca-0.0.7/libdca/tables_quantization.h
Examining data/libdca-0.0.7/libdca/tables_vq.h
Examining data/libdca-0.0.7/src/dcadec.c
Examining data/libdca-0.0.7/src/extract_dca.c
Examining data/libdca-0.0.7/src/getopt.c
Examining data/libdca-0.0.7/src/getopt.h
Examining data/libdca-0.0.7/src/gettimeofday.c
Examining data/libdca-0.0.7/src/gettimeofday.h
Examining data/libdca-0.0.7/test/compare.c
Examining data/libdca-0.0.7/vc++/config.h
Examining data/libdca-0.0.7/vc++/inttypes.h

FINAL RESULTS:

data/libdca-0.0.7/src/dcadec.c:613:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    fprintf (stderr, PACKAGE"-"VERSION
data/libdca-0.0.7/src/dcadec.c:165:17:  [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 ((c = getopt (argc, argv, "hs::t:Tcrag:o:")) != -1)
data/libdca-0.0.7/src/extract_dca.c:62:17:  [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 ((c = getopt (argc, argv, "hs:t:T")) != -1)
data/libdca-0.0.7/src/getopt.c:210:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
#ifndef getenv
data/libdca-0.0.7/src/getopt.c:211:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
extern char *getenv ();
data/libdca-0.0.7/src/getopt.c:403:21:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  posixly_correct = getenv ("POSIXLY_CORRECT");
data/libdca-0.0.7/src/getopt.c:972:1:  [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.
getopt (argc, argv, optstring)
data/libdca-0.0.7/src/getopt.c:1002:11:  [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.
      c = getopt (argc, argv, "abc:d:0123456789");
data/libdca-0.0.7/src/getopt.h:134:12:  [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.
extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
data/libdca-0.0.7/src/getopt.h:136:12:  [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.
extern int getopt ();
data/libdca-0.0.7/src/getopt.h:140:12:  [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.
extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
data/libdca-0.0.7/src/getopt.h:153:12:  [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.
extern int getopt ();
data/libdca-0.0.7/src/getopt.h:155:12:  [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.
extern int getopt_long ();
data/libdca-0.0.7/include/audio_out.h:38:17:  [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).
    ao_open_t * open;
data/libdca-0.0.7/libao/audio_out_oss.c:164:20:  [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).
    instance->fd = open (OSS_DEVICE, O_WRONLY);
data/libdca-0.0.7/libao/audio_out_solaris.c:148:20:  [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).
    instance->fd = open ("/dev/audio", O_WRONLY);
data/libdca-0.0.7/libdca/downmix.c:532:2:  [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 (samples + 256, samples, 256 * sizeof (sample_t));
data/libdca-0.0.7/libdca/downmix.c:597:2:  [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 (samples + 512, samples + 768, 256 * sizeof (sample_t));
data/libdca-0.0.7/libdca/downmix.c:614:2:  [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 (samples + 768, samples + 512, 256 * sizeof (sample_t));
data/libdca-0.0.7/libdca/downmix.c:619:2:  [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 (samples + 512, samples + 768, 256 * sizeof (sample_t));
data/libdca-0.0.7/libdca/downmix.c:624:2:  [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 (samples + 512, samples + 768, 256 * sizeof (sample_t));
data/libdca-0.0.7/libdca/downmix.c:625:2:  [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 (samples + 768, samples + 1024, 256 * sizeof (sample_t));
data/libdca-0.0.7/libdca/downmix.c:629:2:  [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 (samples + 1024, samples + 768, 256 * sizeof (sample_t));
data/libdca-0.0.7/libdca/downmix.c:660:2:  [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 (samples + 512, samples + 256, 256 * sizeof (sample_t));
data/libdca-0.0.7/libdca/downmix.c:687:2:  [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 (samples + 768, samples + 512, 256 * sizeof (sample_t));
data/libdca-0.0.7/libdca/downmix.c:691:2:  [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 (samples + 1024, samples + 768, 256 * sizeof (sample_t));
data/libdca-0.0.7/src/dcadec.c:170:32:  [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).
		    output_open = drivers[i].open;
data/libdca-0.0.7/src/dcadec.c:229:27:  [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).
	output_open = drivers[0].open;
data/libdca-0.0.7/src/dcadec.c:232:12:  [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).
	in_file = fopen (argv[optind], "rb");
data/libdca-0.0.7/src/dcadec.c:266:2:  [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 (bufptr, start, len);
data/libdca-0.0.7/src/dcadec.c:357: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 (header + bytes, buf, missing);	\
data/libdca-0.0.7/src/dcadec.c:361: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 (header + bytes, buf, end - buf);	\
data/libdca-0.0.7/src/dcadec.c:366: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 (head_buf, header, bytes);		\
data/libdca-0.0.7/src/dcadec.c:589:2:  [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, buf, end - buf);
data/libdca-0.0.7/src/extract_dca.c:91:12:  [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).
	in_file = fopen (argv[optind], "rb");
data/libdca-0.0.7/src/extract_dca.c:143: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 (header + bytes, buf, missing);	\
data/libdca-0.0.7/src/extract_dca.c:147: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 (header + bytes, buf, end - buf);	\
data/libdca-0.0.7/src/extract_dca.c:152: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 (head_buf, header, bytes);		\
data/libdca-0.0.7/src/extract_dca.c:375:2:  [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, buf, end - buf);
data/libdca-0.0.7/test/compare.c:40:10:  [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).
    f1 = fopen (argv[1], "rb");
data/libdca-0.0.7/test/compare.c:41:10:  [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).
    f2 = fopen (argv[2], "rb");
data/libdca-0.0.7/libdca/parse.c:53:8:  [1] (free) memalign:
  On some systems (though not Linux-based systems) an attempt to free()
  results from memalign() may fail. This may, on a few systems, be
  exploitable. Also note that memalign() may not check that the boundary
  parameter is correct (CWE-676). Use posix_memalign instead (defined in
  POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD
  4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases,
  malloc()'s alignment may be sufficient.
void * memalign (size_t align, size_t size);
data/libdca-0.0.7/libdca/parse.c:56:9:  [1] (free) memalign:
  On some systems (though not Linux-based systems) an attempt to free()
  results from memalign() may fail. This may, on a few systems, be
  exploitable. Also note that memalign() may not check that the boundary
  parameter is correct (CWE-676). Use posix_memalign instead (defined in
  POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD
  4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases,
  malloc()'s alignment may be sufficient.
#define memalign(align,size) malloc (size)
data/libdca-0.0.7/libdca/parse.c:82:35:  [1] (free) memalign:
  On some systems (though not Linux-based systems) an attempt to free()
  results from memalign() may fail. This may, on a few systems, be
  exploitable. Also note that memalign() may not check that the boundary
  parameter is correct (CWE-676). Use posix_memalign instead (defined in
  POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD
  4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases,
  malloc()'s alignment may be sufficient.
    state->samples = (sample_t *) memalign (16, 256 * 12 * sizeof (sample_t));
data/libdca-0.0.7/src/getopt.c:233:51:  [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 (!defined __STDC__ || !__STDC__) && !defined strlen
data/libdca-0.0.7/src/getopt.c:236:12:  [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).
extern int strlen (const char *);
data/libdca-0.0.7/src/getopt.c:434:44:  [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 = nonoption_flags_max_len = strlen (orig_str);
data/libdca-0.0.7/src/getopt.c:659: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).
		== (unsigned int) strlen (p->name))
data/libdca-0.0.7/src/getopt.c:683:16:  [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).
	  nextchar += strlen (nextchar);
data/libdca-0.0.7/src/getopt.c:715: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).
		  nextchar += strlen (nextchar);
data/libdca-0.0.7/src/getopt.c:731: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).
		  nextchar += strlen (nextchar);
data/libdca-0.0.7/src/getopt.c:736:16:  [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).
	  nextchar += strlen (nextchar);
data/libdca-0.0.7/src/getopt.c:847:51:  [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 ((unsigned int) (nameend - nextchar) == strlen (p->name))
data/libdca-0.0.7/src/getopt.c:870: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).
	    nextchar += strlen (nextchar);
data/libdca-0.0.7/src/getopt.c:890: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).
		    nextchar += strlen (nextchar);
data/libdca-0.0.7/src/getopt.c:904: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).
		    nextchar += strlen (nextchar);
data/libdca-0.0.7/src/getopt.c:908: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).
	    nextchar += strlen (nextchar);

ANALYSIS SUMMARY:

Hits = 57
Lines analyzed = 16532 in approximately 0.83 seconds (20024 lines/second)
Physical Source Lines of Code (SLOC) = 14043
Hits@level = [0] 165 [1]  16 [2]  28 [3]  12 [4]   1 [5]   0
Hits@level+ = [0+] 222 [1+]  57 [2+]  41 [3+]  13 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 15.8086 [1+] 4.05896 [2+] 2.9196 [3+] 0.925728 [4+] 0.0712099 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
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.