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/adplay-1.8.1/src/adplay.cc
Examining data/adplay-1.8.1/src/alsa.cc
Examining data/adplay-1.8.1/src/alsa.h
Examining data/adplay-1.8.1/src/ao.cc
Examining data/adplay-1.8.1/src/ao.h
Examining data/adplay-1.8.1/src/defines.h
Examining data/adplay-1.8.1/src/esound.cc
Examining data/adplay-1.8.1/src/esound.h
Examining data/adplay-1.8.1/src/getopt.c
Examining data/adplay-1.8.1/src/getopt.h
Examining data/adplay-1.8.1/src/getopt1.c
Examining data/adplay-1.8.1/src/null.h
Examining data/adplay-1.8.1/src/oss.cc
Examining data/adplay-1.8.1/src/oss.h
Examining data/adplay-1.8.1/src/output.cc
Examining data/adplay-1.8.1/src/output.h
Examining data/adplay-1.8.1/src/players.h
Examining data/adplay-1.8.1/src/qsa.cc
Examining data/adplay-1.8.1/src/qsa.h
Examining data/adplay-1.8.1/src/sdl.cc
Examining data/adplay-1.8.1/src/sdl.h
Examining data/adplay-1.8.1/src/disk.cc
Examining data/adplay-1.8.1/src/disk.h

FINAL RESULTS:

data/adplay-1.8.1/src/adplay.cc:127:3:  [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(stderr, fmt, argptr);
data/adplay-1.8.1/src/adplay.cc:389:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(userdb, homedir); strcat(userdb, "/" ADPLUG_CONFDIR "/");
data/adplay-1.8.1/src/adplay.cc:390:5:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
    strcat(userdb, ADPLUGDB_FILE);
data/adplay-1.8.1/src/adplay.cc:240:15:  [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, "8f:b:d:irms:ohVe:O:D:qv",
data/adplay-1.8.1/src/adplay.cc:385:13:  [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.
  homedir = getenv("HOME");
data/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/src/getopt1.c:67:1:  [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.
getopt_long (argc, argv, options, long_options, opt_index)
data/adplay-1.8.1/src/getopt1.c:123: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, argv, "abc:d:0123456789",
data/adplay-1.8.1/src/adplay.cc:245: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).
      case 'f': cfg.freq = atoi(optarg); break;
data/adplay-1.8.1/src/adplay.cc:249:32:  [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).
      case 'b': cfg.buf_size = atoi(optarg); break;
data/adplay-1.8.1/src/adplay.cc:254:31:  [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).
      case 's': cfg.subsong = atoi(optarg); break;
data/adplay-1.8.1/src/adplay.cc:389:30:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
    strcpy(userdb, homedir); strcat(userdb, "/" ADPLUG_CONFDIR "/");
data/adplay-1.8.1/src/oss.cc:42: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).
  if((audio_fd = open(device, O_WRONLY, 0)) == -1) {
data/adplay-1.8.1/src/adplay.cc:387: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).
    userdb = (char *)malloc(strlen(homedir) + strlen(ADPLUG_CONFDIR) +
data/adplay-1.8.1/src/adplay.cc:387:47:  [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).
    userdb = (char *)malloc(strlen(homedir) + strlen(ADPLUG_CONFDIR) +
data/adplay-1.8.1/src/adplay.cc:388: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).
			    strlen(ADPLUGDB_FILE) + 3);
data/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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/adplay-1.8.1/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 = 38
Lines analyzed = 3167 in approximately 0.11 seconds (29630 lines/second)
Physical Source Lines of Code (SLOC) = 1891
Hits@level = [0]  56 [1]  16 [2]   5 [3]  14 [4]   3 [5]   0
Hits@level+ = [0+]  94 [1+]  38 [2+]  22 [3+]  17 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 49.7091 [1+] 20.0952 [2+] 11.6341 [3+] 8.98995 [4+] 1.58646 [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.