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/libsamplerate-0.1.9/examples/varispeed-play.c
Examining data/libsamplerate-0.1.9/examples/timewarp-file.c
Examining data/libsamplerate-0.1.9/examples/audio_out.h
Examining data/libsamplerate-0.1.9/examples/audio_out.c
Examining data/libsamplerate-0.1.9/examples/sndfile-resample.c
Examining data/libsamplerate-0.1.9/src/samplerate.h
Examining data/libsamplerate-0.1.9/src/src_sinc.c
Examining data/libsamplerate-0.1.9/src/fastest_coeffs.h
Examining data/libsamplerate-0.1.9/src/high_qual_coeffs.h
Examining data/libsamplerate-0.1.9/src/float_cast.h
Examining data/libsamplerate-0.1.9/src/src_linear.c
Examining data/libsamplerate-0.1.9/src/common.h
Examining data/libsamplerate-0.1.9/src/samplerate.c
Examining data/libsamplerate-0.1.9/src/src_zoh.c
Examining data/libsamplerate-0.1.9/src/mid_qual_coeffs.h
Examining data/libsamplerate-0.1.9/tests/reset_test.c
Examining data/libsamplerate-0.1.9/tests/misc_test.c
Examining data/libsamplerate-0.1.9/tests/multi_channel_test.c
Examining data/libsamplerate-0.1.9/tests/calc_snr.c
Examining data/libsamplerate-0.1.9/tests/util.c
Examining data/libsamplerate-0.1.9/tests/callback_test.c
Examining data/libsamplerate-0.1.9/tests/float_short_test.c
Examining data/libsamplerate-0.1.9/tests/snr_bw_test.c
Examining data/libsamplerate-0.1.9/tests/callback_hang_test.c
Examining data/libsamplerate-0.1.9/tests/termination_test.c
Examining data/libsamplerate-0.1.9/tests/simple_test.c
Examining data/libsamplerate-0.1.9/tests/util.h
Examining data/libsamplerate-0.1.9/tests/downsample_test.c
Examining data/libsamplerate-0.1.9/tests/src-evaluate.c
Examining data/libsamplerate-0.1.9/tests/varispeed_test.c
Examining data/libsamplerate-0.1.9/tests/multichan_throughput_test.c
Examining data/libsamplerate-0.1.9/tests/throughput_test.c
Examining data/libsamplerate-0.1.9/Win32/unistd.h
Examining data/libsamplerate-0.1.9/Win32/config.h

FINAL RESULTS:

data/libsamplerate-0.1.9/examples/audio_out.c:978:7:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
		if (access ("/proc/asound/cards", R_OK) == 0)
data/libsamplerate-0.1.9/tests/src-evaluate.c:216:14:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	if ((file = popen (prog->version_cmd, "r")) == NULL)
data/libsamplerate-0.1.9/tests/src-evaluate.c:341:3:  [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.
		snprintf (command, sizeof (command), prog->convert_cmd, snr_test [k].output_samplerate) ;
data/libsamplerate-0.1.9/tests/src-evaluate.c:343:17:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		if ((retval = system (command)) != 0)
data/libsamplerate-0.1.9/tests/src-evaluate.c:413:2:  [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.
	snprintf (command, sizeof (command), prog->convert_cmd, 88189) ;
data/libsamplerate-0.1.9/tests/src-evaluate.c:415:16:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	if ((retval = system (command)) != 0)
data/libsamplerate-0.1.9/tests/util.c:171:9:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	file = popen ("/usr/sbin/system_profiler -detailLevel full SPHardwareDataType", "r") ;
data/libsamplerate-0.1.9/tests/util.c:175:9:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	file = popen ("sysctl -a", "r") ;
data/libsamplerate-0.1.9/examples/audio_out.c:339:30:  [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).
	if ((opensoundsys_out->fd = open ("/dev/dsp", O_WRONLY, 0)) == -1)
data/libsamplerate-0.1.9/examples/audio_out.c:897:25:  [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).
	if ((solaris_out->fd = open ("/dev/audio", O_WRONLY | O_NONBLOCK)) < 0)
data/libsamplerate-0.1.9/examples/sndfile-resample.c:41: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 buffer [64], *cptr ;
data/libsamplerate-0.1.9/examples/sndfile-resample.c:67: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).
			new_sample_rate = atoi (argv [k]) ;
data/libsamplerate-0.1.9/examples/sndfile-resample.c:75:16:  [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).
			converter = atoi (argv [k]) ;
data/libsamplerate-0.1.9/examples/sndfile-resample.c:261: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 lsf_ver [128] ;
data/libsamplerate-0.1.9/examples/varispeed-play.c:93: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).
		converter = atoi (argv [2]) ;
data/libsamplerate-0.1.9/src/src_sinc.c:1156: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 (filter->buffer + filter->b_end, data->data_in + filter->in_used,
data/libsamplerate-0.1.9/tests/multichan_throughput_test.c:187: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).
	{	int run_count = atoi (argv [2]) ;
data/libsamplerate-0.1.9/tests/src-evaluate.c:62:8:  [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 char	version_string [512] ;
data/libsamplerate-0.1.9/tests/src-evaluate.c:130:10:  [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).
		prog = atoi (argv [2]) ;
data/libsamplerate-0.1.9/tests/src-evaluate.c:134:10:  [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).
		prog = atoi (argv [1]) ;
data/libsamplerate-0.1.9/tests/src-evaluate.c:186:10:  [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 char namestr [256] ;
data/libsamplerate-0.1.9/tests/src-evaluate.c:325: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.
	static char command [256] ;
data/libsamplerate-0.1.9/tests/src-evaluate.c:402:10:  [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 char	command [256] ;
data/libsamplerate-0.1.9/tests/throughput_test.c:187: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).
	{	int run_count = atoi (argv [2]) ;
data/libsamplerate-0.1.9/tests/util.c:62: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).
	if (! (file = fopen (filename, "w")))
data/libsamplerate-0.1.9/tests/util.c:94: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).
	if (! (file = fopen (filename, "w")))
data/libsamplerate-0.1.9/tests/util.c:163: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.
	static char buffer [512] ;
data/libsamplerate-0.1.9/tests/util.c:168:9:  [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 = fopen ("/proc/cpuinfo", "r") ;
data/libsamplerate-0.1.9/examples/audio_out.c:564:3:  [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 (10 * 1000) ; /* 10 000 milliseconds. */
data/libsamplerate-0.1.9/tests/src-evaluate.c:33:33:  [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).
			safe_strncat_count = (len) - strlen (dest) - 1 ;	\
data/libsamplerate-0.1.9/tests/src-evaluate.c:34:4:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
			strncat ((dest), (src), safe_strncat_count) ;		\
data/libsamplerate-0.1.9/tests/src-evaluate.c:239:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy (version_string, cptr, sizeof (version_string)) ;

ANALYSIS SUMMARY:

Hits = 32
Lines analyzed = 373863 in approximately 12.46 seconds (30001 lines/second)
Physical Source Lines of Code (SLOC) = 370848
Hits@level = [0] 344 [1]   4 [2]  20 [3]   0 [4]   8 [5]   0
Hits@level+ = [0+] 376 [1+]  32 [2+]  28 [3+]   8 [4+]   8 [5+]   0
Hits/KSLOC@level+ = [0+] 1.01389 [1+] 0.0862887 [2+] 0.0755026 [3+] 0.0215722 [4+] 0.0215722 [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.