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/xmp-4.1.0/src/sound_hpux.c
Examining data/xmp-4.1.0/src/win32/unistd.h
Examining data/xmp-4.1.0/src/win32/usleep.c
Examining data/xmp-4.1.0/src/sound_pulseaudio.c
Examining data/xmp-4.1.0/src/list.h
Examining data/xmp-4.1.0/src/sound_null.c
Examining data/xmp-4.1.0/src/sound_alsa05.c
Examining data/xmp-4.1.0/src/info.c
Examining data/xmp-4.1.0/src/common.h
Examining data/xmp-4.1.0/src/sound_sgi.c
Examining data/xmp-4.1.0/src/sound_bsd.c
Examining data/xmp-4.1.0/src/getopt.h
Examining data/xmp-4.1.0/src/getopt1.c
Examining data/xmp-4.1.0/src/options.c
Examining data/xmp-4.1.0/src/sound_win32.c
Examining data/xmp-4.1.0/src/main.c
Examining data/xmp-4.1.0/src/sound_alsa.c
Examining data/xmp-4.1.0/src/sound_ahi.c
Examining data/xmp-4.1.0/src/sound_qnx.c
Examining data/xmp-4.1.0/src/sound_solaris.c
Examining data/xmp-4.1.0/src/sound_file.c
Examining data/xmp-4.1.0/src/sound_aiff.c
Examining data/xmp-4.1.0/src/terminal.c
Examining data/xmp-4.1.0/src/sound_dart.c
Examining data/xmp-4.1.0/src/sound_coreaudio.c
Examining data/xmp-4.1.0/src/sound_aix.c
Examining data/xmp-4.1.0/src/read_config.c
Examining data/xmp-4.1.0/src/sound.c
Examining data/xmp-4.1.0/src/commands.c
Examining data/xmp-4.1.0/src/sound_sndio.c
Examining data/xmp-4.1.0/src/sound_wav.c
Examining data/xmp-4.1.0/src/getopt.c
Examining data/xmp-4.1.0/src/sound.h
Examining data/xmp-4.1.0/src/sound_beos.cpp
Examining data/xmp-4.1.0/src/sound_oss.c
Examining data/xmp-4.1.0/src/sound_netbsd.c

FINAL RESULTS:

data/xmp-4.1.0/src/common.h:13: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/xmp-4.1.0/src/common.h:13: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/xmp-4.1.0/src/info.c:129:2:  [4] (format) vsnprintf:
  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.
	vsnprintf(msg_text, MSG_SIZE, format, ap);
data/xmp-4.1.0/src/main.c:43:6:  [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.
	n = vfprintf(stderr, fmt, a);
data/xmp-4.1.0/src/sound.h:36:10:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
	if (2 > sscanf(token, y, z, w)) parm_error(); } }
data/xmp-4.1.0/src/common.h:38:6:  [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;		/* play in random order */
data/xmp-4.1.0/src/getopt.c:374: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/xmp-4.1.0/src/getopt.c:403:25:  [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.
      nonoption_flags = getenv (var);
data/xmp-4.1.0/src/getopt.c:927: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/xmp-4.1.0/src/getopt.c:957: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/xmp-4.1.0/src/getopt.h:106: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/xmp-4.1.0/src/getopt.h:108: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/xmp-4.1.0/src/getopt.h:110: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/xmp-4.1.0/src/getopt.h:122: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/xmp-4.1.0/src/getopt.h:123: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/xmp-4.1.0/src/getopt1.c:75: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/xmp-4.1.0/src/getopt1.c:131: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/xmp-4.1.0/src/main.c:250:2:  [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(tv.tv_usec);
data/xmp-4.1.0/src/main.c:252:2:  [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(GetTickCount());
data/xmp-4.1.0/src/main.c:375:10:  [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 (opt.random) {
data/xmp-4.1.0/src/options.c:186:14:  [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 ((o = getopt_long(argc, argv, OPTIONS, lopt, &optidx)) != -1) {
data/xmp-4.1.0/src/read_config.c:47:15:  [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.
	char *home = getenv("HOME");
data/xmp-4.1.0/src/read_config.c:62: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.
	const char *home = getenv("USERPROFILE");
data/xmp-4.1.0/src/read_config.c:70:15:  [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.
	char *home = getenv("HOME");
data/xmp-4.1.0/src/read_config.c:285:15:  [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.
	char *home = getenv("HOME");
data/xmp-4.1.0/src/read_config.c:294: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.
	const char *home = getenv("USERPROFILE");
data/xmp-4.1.0/src/read_config.c:301:15:  [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.
	char *home = getenv("HOME");
data/xmp-4.1.0/src/common.h:7:9:  [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).
#define open _open
data/xmp-4.1.0/src/common.h:59:2:  [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 *driver_parm[MAX_DRV_PARM]; /* driver parameters */
data/xmp-4.1.0/src/common.h:60:2:  [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 mute[XMP_MAX_CHANNELS];
data/xmp-4.1.0/src/getopt.c:401:7:  [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 var[100];
data/xmp-4.1.0/src/getopt.c:402:7:  [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 (var, "_%d_GNU_nonoption_argv_flags_", getpid ());
data/xmp-4.1.0/src/info.c:121: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 msg_text[MSG_SIZE];
data/xmp-4.1.0/src/info.c:140:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(buf, "++");
data/xmp-4.1.0/src/info.c:147:2:  [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 rowstr[3], numrowstr[3];
data/xmp-4.1.0/src/info.c:148:2:  [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 chnstr[3], maxchnstr[3];
data/xmp-4.1.0/src/main.c:367: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(&save_opt, &opt, sizeof (struct options));
data/xmp-4.1.0/src/main.c:380: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(&opt, &save_opt, sizeof (struct options));
data/xmp-4.1.0/src/main.c:559:7:  [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 buf[80];
data/xmp-4.1.0/src/options.c:192: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).
			options->amplify = atoi(optarg);
data/xmp-4.1.0/src/options.c:195:8:  [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(optarg) == 8) {
data/xmp-4.1.0/src/options.c:329:5:  [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 buf[40];
data/xmp-4.1.0/src/options.c:334: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).
					a = atoi(buf);
data/xmp-4.1.0/src/options.c:337: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).
					b = atoi(buf);
data/xmp-4.1.0/src/options.c:339:14:  [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).
					a = b = atoi(token);
data/xmp-4.1.0/src/read_config.c:20: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 driver[32];
data/xmp-4.1.0/src/read_config.c:21: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 instrument_path[256];
data/xmp-4.1.0/src/read_config.c:42:2:  [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 myrc[PATH_MAX];
data/xmp-4.1.0/src/read_config.c:43:2:  [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 *hash, *var, *val, line[256];
data/xmp-4.1.0/src/read_config.c:44:2:  [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 cparm[512];
data/xmp-4.1.0/src/read_config.c:51: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).
	if ((rc = fopen(myrc, "r")) == NULL) {
data/xmp-4.1.0/src/read_config.c:52:13:  [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 ((rc = fopen("xmp.conf", "r")) == NULL) {
data/xmp-4.1.0/src/read_config.c:59: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).
	if ((rc = fopen(myrc, "r")) == NULL)
data/xmp-4.1.0/src/read_config.c:67: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).
	if ((rc = fopen(myrc, "r")) == NULL)
data/xmp-4.1.0/src/read_config.c:74: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).
	if ((rc = fopen(myrc, "r")) == NULL) {
data/xmp-4.1.0/src/read_config.c:76:13:  [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 ((rc = fopen(myrc, "r")) == NULL) {
data/xmp-4.1.0/src/read_config.c:109: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).
	if (!strcmp(var,x)) { y = atoi (val); continue; } }
data/xmp-4.1.0/src/read_config.c:147:8:  [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(val) == 8)
data/xmp-4.1.0/src/read_config.c:179: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 hex[3];
data/xmp-4.1.0/src/read_config.c:194:2:  [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 *hash, *var, *val, line[256];
data/xmp-4.1.0/src/read_config.c:199: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).
	if ((rc = fopen(confname, "r")) == NULL)
data/xmp-4.1.0/src/read_config.c:284:2:  [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 myrc[PATH_MAX];
data/xmp-4.1.0/src/read_config.c:293:2:  [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 myrc[PATH_MAX];
data/xmp-4.1.0/src/read_config.c:300:2:  [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 myrc[PATH_MAX];
data/xmp-4.1.0/src/sound.h:23:2:  [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 s[80]; strncpy(s, *(p), 79); s[79] = 0; \
data/xmp-4.1.0/src/sound_ahi.c:22:2:  [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 outfile[256];
data/xmp-4.1.0/src/sound_ahi.c:31:2:  [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(outfile, "AUDIO:B/%d/F/%d/C/%d/BUFFER/%d",
data/xmp-4.1.0/src/sound_ahi.c:34:7:  [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).
	fd = open(outfile, O_WRONLY);
data/xmp-4.1.0/src/sound_aiff.c:62:2:  [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 hed[54] = {
data/xmp-4.1.0/src/sound_aiff.c:100:8:  [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).
		fd = open(options->out_file, O_WRONLY|O_CREAT|O_TRUNC, 0644);
data/xmp-4.1.0/src/sound_aix.c:50: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("/dev/paud0/1", O_WRONLY)) == -1)
data/xmp-4.1.0/src/sound_alsa05.c:173: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(mybuffer_nextfree, b, to_copy);
data/xmp-4.1.0/src/sound_beos.cpp:98: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_write_pos, data, first_len);
data/xmp-4.1.0/src/sound_beos.cpp:101: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(buffer, data + first_len, len - first_len);
data/xmp-4.1.0/src/sound_beos.cpp:120: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(data, buffer + buf_read_pos, first_len);
data/xmp-4.1.0/src/sound_beos.cpp:123: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 + first_len, buffer, len - first_len);
data/xmp-4.1.0/src/sound_bsd.c:39: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("/dev/sound", O_WRONLY)) == -1)
data/xmp-4.1.0/src/sound_coreaudio.c:75: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_write_pos, data, first_len);
data/xmp-4.1.0/src/sound_coreaudio.c:78: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(buffer, data + first_len, len - first_len);
data/xmp-4.1.0/src/sound_coreaudio.c:97: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(data, buffer + buf_read_pos, first_len);
data/xmp-4.1.0/src/sound_coreaudio.c:100: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 + first_len, buffer, len - first_len);
data/xmp-4.1.0/src/sound_dart.c:81:30:  [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).
	chkparm1("device", device = atoi(token));
data/xmp-4.1.0/src/sound_dart.c:193: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(&((char *)MixBuffers[next].pBuffer)[index], b, i);
data/xmp-4.1.0/src/sound_dart.c:193: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.
	memcpy(&((char *)MixBuffers[next].pBuffer)[index], b, i);
data/xmp-4.1.0/src/sound_file.c:44:8:  [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).
		fd = open(options->out_file, O_WRONLY | O_CREAT | O_TRUNC
data/xmp-4.1.0/src/sound_hpux.c:56: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("/dev/audio", O_WRONLY)) == -1)
data/xmp-4.1.0/src/sound_netbsd.c:39: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("/dev/sound", O_WRONLY)) == -1)
data/xmp-4.1.0/src/sound_netbsd.c:43:21:  [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 ((audioctl_fd = open("/dev/audioctl", O_RDWR)) < 0) {
data/xmp-4.1.0/src/sound_oss.c:114: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 buf[80];
data/xmp-4.1.0/src/sound_oss.c:131:19:  [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(dev_audio[i], O_WRONLY)) >= 0)
data/xmp-4.1.0/src/sound_qnx.c:35:13:  [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).
	fd_audio = open(dev, O_WRONLY);
data/xmp-4.1.0/src/sound_solaris.c:57: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("/dev/audio", O_WRONLY)) == -1)
data/xmp-4.1.0/src/sound_solaris.c:61:21:  [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 ((audioctl_fd = open("/dev/audioctl", O_RDWR)) < 0) {
data/xmp-4.1.0/src/sound_wav.c:71:8:  [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).
		fd = open(options->out_file, O_WRONLY | O_CREAT | O_TRUNC
data/xmp-4.1.0/src/sound_win32.c:128: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[nextbuffer], b, len);
data/xmp-4.1.0/src/commands.c:67:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(0, &key, 1);
data/xmp-4.1.0/src/getopt.c:246: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/xmp-4.1.0/src/getopt.c:407:24:  [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).
	nonoption_flags_len = strlen (nonoption_flags);
data/xmp-4.1.0/src/getopt.c:615: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/xmp-4.1.0/src/getopt.c:639: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/xmp-4.1.0/src/getopt.c:670: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/xmp-4.1.0/src/getopt.c:686: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/xmp-4.1.0/src/getopt.c:691: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/xmp-4.1.0/src/getopt.c:802: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/xmp-4.1.0/src/getopt.c:825: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/xmp-4.1.0/src/getopt.c:845: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/xmp-4.1.0/src/getopt.c:859: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/xmp-4.1.0/src/getopt.c:863: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/xmp-4.1.0/src/info.c:239:7:  [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(ins->name) == 0 && ins->nsm == 0) {
data/xmp-4.1.0/src/info.c:288:7:  [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(ins->name) == 0 && ins->nsm == 0) {
data/xmp-4.1.0/src/info.c:338:7:  [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(smp->name) == 0 && smp->len == 0) {
data/xmp-4.1.0/src/main.c:155:4:  [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(100000);
data/xmp-4.1.0/src/options.c:282: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(optarg) >= 4 &&
data/xmp-4.1.0/src/options.c:283: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).
			    !strcasecmp(optarg + strlen(optarg) - 4, ".wav")) {
data/xmp-4.1.0/src/options.c:285: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).
			} else if (strlen(optarg) >= 5 &&
data/xmp-4.1.0/src/options.c:286: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).
			    !strcasecmp(optarg + strlen(optarg) - 5, ".aiff")) {
data/xmp-4.1.0/src/options.c:333:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
					strncpy(buf, token, b);
data/xmp-4.1.0/src/options.c:335:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
					strncpy(buf, token + b + 1,
data/xmp-4.1.0/src/options.c:336:7:  [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(token) - b - 1);
data/xmp-4.1.0/src/read_config.c:27:22:  [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).
			memmove(s, s + 1, strlen(s));
data/xmp-4.1.0/src/read_config.c:57:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
	strncpy(myrc, "PROGDIR:xmp.conf", PATH_MAX);
data/xmp-4.1.0/src/read_config.c:75:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(myrc, SYSCONFDIR "/xmp.conf", PATH_MAX);
data/xmp-4.1.0/src/read_config.c:84:44:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (fscanf(rc, "%255[^\n]", line) < 0 || fgetc(rc) < 0) {
data/xmp-4.1.0/src/read_config.c:128:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(driver, val, 31);
data/xmp-4.1.0/src/read_config.c:153:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(instrument_path, val, 255);
data/xmp-4.1.0/src/read_config.c:204:44:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (fscanf(rc, "%255[^\n]", line) < 0 || fgetc(rc) < 0) {
data/xmp-4.1.0/src/sound.h:23:14:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	char s[80]; strncpy(s, *(p), 79); s[79] = 0; \
data/xmp-4.1.0/src/sound_coreaudio.c:233: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(100000);
data/xmp-4.1.0/src/sound_file.c:53:13:  [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(sound_file.description) +
data/xmp-4.1.0/src/sound_file.c:54:5:  [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(options->out_file) + 8;
data/xmp-4.1.0/src/sound_wav.c:80:13:  [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(sound_wav.description) +
data/xmp-4.1.0/src/sound_wav.c:81:5:  [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(options->out_file) + 8;
data/xmp-4.1.0/src/win32/unistd.h:6:6:  [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.
void usleep(long usec);
data/xmp-4.1.0/src/win32/usleep.c:13:6:  [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.
void usleep(long usec)
data/xmp-4.1.0/src/win32/usleep.c:28:6:  [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.
void usleep (long usec)

ANALYSIS SUMMARY:

Hits = 135
Lines analyzed = 7175 in approximately 0.18 seconds (40553 lines/second)
Physical Source Lines of Code (SLOC) = 5138
Hits@level = [0]  98 [1]  40 [2]  68 [3]  22 [4]   5 [5]   0
Hits@level+ = [0+] 233 [1+] 135 [2+]  95 [3+]  27 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 45.3484 [1+] 26.2748 [2+] 18.4897 [3+] 5.25496 [4+] 0.973141 [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.