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/mpc123-0.2.4/playlist.c
Examining data/mpc123-0.2.4/shuffle.c
Examining data/mpc123-0.2.4/mpc123.c
Examining data/mpc123-0.2.4/reader.c
Examining data/mpc123-0.2.4/signals.c
Examining data/mpc123-0.2.4/mpc123.h
Examining data/mpc123-0.2.4/player.c
Examining data/mpc123-0.2.4/reader_file.c
Examining data/mpc123-0.2.4/ao.c

FINAL RESULTS:

data/mpc123-0.2.4/mpc123.h:80: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(stdout, _(txt)); \
data/mpc123-0.2.4/mpc123.h:86: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(stdout, _(txt), __VA_ARGS__); \
data/mpc123-0.2.4/mpc123.h:94:3:  [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, _(x)); \
data/mpc123-0.2.4/mpc123.h:99:3:  [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, _(x), __VA_ARGS__); \
data/mpc123-0.2.4/mpc123.c:112:7:  [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.
  if(!getenv("MALLOC_TRACE")){
data/mpc123-0.2.4/mpc123.c:117: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.
           argv[0], getenv("MALLOC_TRACE"));
data/mpc123-0.2.4/mpc123.c:121:13:  [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 ((c=getopt_long(argc, argv, _GETOPT_FLAGS, myOpt, NULL)) != -1){
data/mpc123-0.2.4/mpc123.c:204:35:  [3] (random) random:
  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.
         options.shuffle, options.random, options.verbosity,
data/mpc123-0.2.4/mpc123.h:105:7:  [3] (random) random:
  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.
  int random;		/* playlist entries are randomly chosen */
data/mpc123-0.2.4/playlist.c:91:34:  [3] (random) random:
  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.
  if(options.shuffle && !options.random){
data/mpc123-0.2.4/playlist.c:123:14:  [3] (random) random:
  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.
  if(options.random){
data/mpc123-0.2.4/playlist.c:124:5:  [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(time(NULL));                  /* in case we want to use rand() */
data/mpc123-0.2.4/playlist.c:159:21:  [3] (random) random:
  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.
            options.random, current, pl->files[current+1],
data/mpc123-0.2.4/playlist.c:161:18:  [3] (random) random:
  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.
    if((!options.random && !pl->files[current+1])
data/mpc123-0.2.4/playlist.c:166:16:  [3] (random) random:
  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.
    if(options.random){
data/mpc123-0.2.4/shuffle.c:36: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(time(NULL));
data/mpc123-0.2.4/playlist.c:33: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).
  FILE *fd  =  fopen(fname, "r");
data/mpc123-0.2.4/reader.c:36:12:  [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).
  data->fd=open(fname, O_RDONLY);
data/mpc123-0.2.4/ao.c:53: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).
  if ( !strncmp(options.ao_driver, "alsa", strlen("alsa")) ){
data/mpc123-0.2.4/playlist.c:47: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).
    sl=strlen(strFile);
data/mpc123-0.2.4/playlist.c:57:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(pl->files[i], strFile, sl);
data/mpc123-0.2.4/playlist.c:98:10:  [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).
      sl=strlen(argv[i]);
data/mpc123-0.2.4/playlist.c:100:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(pl->files[i], argv[i], sl+1);
data/mpc123-0.2.4/reader_file.c:28:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  return read(data->fd, ptr, size);
data/mpc123-0.2.4/shuffle.c:51:10:  [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).
    sl = strlen(argv[shuffind]);
data/mpc123-0.2.4/shuffle.c:53:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(files[i], argv[shuffind], sl);

ANALYSIS SUMMARY:

Hits = 26
Lines analyzed = 1253 in approximately 0.05 seconds (26994 lines/second)
Physical Source Lines of Code (SLOC) = 773
Hits@level = [0]   6 [1]   8 [2]   2 [3]  12 [4]   4 [5]   0
Hits@level+ = [0+]  32 [1+]  26 [2+]  18 [3+]  16 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 41.3972 [1+] 33.6352 [2+] 23.2859 [3+] 20.6986 [4+] 5.17464 [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.