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/pax-utils-1.2.6/dumpelf.c
Examining data/pax-utils-1.2.6/elf.h
Examining data/pax-utils-1.2.6/macho.h
Examining data/pax-utils-1.2.6/paxelf.c
Examining data/pax-utils-1.2.6/paxelf.h
Examining data/pax-utils-1.2.6/paxinc.c
Examining data/pax-utils-1.2.6/paxinc.h
Examining data/pax-utils-1.2.6/paxldso.c
Examining data/pax-utils-1.2.6/paxldso.h
Examining data/pax-utils-1.2.6/paxmacho.c
Examining data/pax-utils-1.2.6/paxmacho.h
Examining data/pax-utils-1.2.6/porting.h
Examining data/pax-utils-1.2.6/pspax.c
Examining data/pax-utils-1.2.6/scanelf.c
Examining data/pax-utils-1.2.6/scanmacho.c
Examining data/pax-utils-1.2.6/security.c
Examining data/pax-utils-1.2.6/security.h
Examining data/pax-utils-1.2.6/xfuncs.c
Examining data/pax-utils-1.2.6/xfuncs.h

FINAL RESULTS:

data/pax-utils-1.2.6/security.c:156:12:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
		SCMP_SYS(readlink),
data/pax-utils-1.2.6/dumpelf.c:60:2:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	printf( \
data/pax-utils-1.2.6/pspax.c:87:6:  [4] (buffer) fscanf:
  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 (fscanf(fp, "%s.1023", str) != 1) {
data/pax-utils-1.2.6/pspax.c:108:6:  [4] (buffer) fscanf:
  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 (fscanf(fp, "%*d %s.16", str) != 1) {
data/pax-utils-1.2.6/pspax.c:351:6:  [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/self/attr/current", R_OK) != -1)
data/pax-utils-1.2.6/pspax.c:356: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/self/ipaddr", R_OK) != -1) && show_addr)
data/pax-utils-1.2.6/scanelf.c:126: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(p, R_OK) != -1)
data/pax-utils-1.2.6/scanelf.c:406:3:  [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(ret, paxflags);
data/pax-utils-1.2.6/scanelf.c:755:9:  [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 (system(sysbuf)) {/* don't care */} \
data/pax-utils-1.2.6/scanelf.c:1538:13:  [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.
		case 'Z': snprintf(ubuf, sizeof(ubuf), "%"PRIu64, (uint64_t)elf->len); out = ubuf; break;;
data/pax-utils-1.2.6/security.c:134:12:  [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.
		SCMP_SYS(access),
data/pax-utils-1.2.6/xfuncs.c:56:3:  [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(*dst, src);
data/pax-utils-1.2.6/dumpelf.c:544: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 ((flag=getopt_long(argc, argv, PARSE_FLAGS, long_opts, NULL)) != -1) {
data/pax-utils-1.2.6/paxinc.c:163: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.
		const char *nocolor = getenv("NOCOLOR");
data/pax-utils-1.2.6/pspax.c:511: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 ((flag=getopt_long(argc, argv, PARSE_FLAGS, long_opts, NULL)) != -1) {
data/pax-utils-1.2.6/scanelf.c:90:6:  [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.
	p = getenv(envvar);
data/pax-utils-1.2.6/scanelf.c:94: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.
	env_path = getenv("PATH");
data/pax-utils-1.2.6/scanelf.c:882:16:  [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.
					tmpdir = (getenv("TMPDIR") ? : "."); \
data/pax-utils-1.2.6/scanelf.c:1816: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.
	path = getenv("PATH");
data/pax-utils-1.2.6/scanelf.c:1991: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.
	while ((i=getopt_long(argc, argv, PARSE_FLAGS, long_opts, NULL)) != -1) {
data/pax-utils-1.2.6/scanelf.c:2291: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.
	if ((env = getenv(envvar)) == NULL)
data/pax-utils-1.2.6/scanmacho.c:522: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.
	path = getenv("PATH");
data/pax-utils-1.2.6/scanmacho.c:628: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 ((i = getopt_long(argc, argv, PARSE_FLAGS, long_opts, NULL)) != -1) {
data/pax-utils-1.2.6/dumpelf.c:267: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[1024];
data/pax-utils-1.2.6/dumpelf.c:293:3:  [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(p, " | 0x%X", flags);
data/pax-utils-1.2.6/dumpelf.c:341: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[20];
data/pax-utils-1.2.6/elf.h:65: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.
  unsigned char	e_ident[EI_NIDENT];	/* Magic number and other info */
data/pax-utils-1.2.6/elf.h:83: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.
  unsigned char	e_ident[EI_NIDENT];	/* Magic number and other info */
data/pax-utils-1.2.6/paxelf.c:138: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[26];
data/pax-utils-1.2.6/paxelf.c:178:9:  [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).
	return atoi(str);
data/pax-utils-1.2.6/paxelf.c:612: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(elf->_data, elf->data, elf->len);
data/pax-utils-1.2.6/paxelf.c:701: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).
	if ((fd = open(filename, (read_only ? O_RDONLY : O_RDWR))) == -1)
data/pax-utils-1.2.6/paxelf.c:732: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[7];
data/pax-utils-1.2.6/paxelf.c:752: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[7];
data/pax-utils-1.2.6/paxelf.c:778: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[4];
data/pax-utils-1.2.6/paxinc.c: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 buf[AR_MAGIC_SIZE];
data/pax-utils-1.2.6/paxinc.c:43:10:  [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 ((fd=open(filename, O_RDONLY)) == -1)
data/pax-utils-1.2.6/paxinc.c:92:9:  [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).
		len = atoi(ret.buf.formatted.size);
data/pax-utils-1.2.6/paxinc.c:107:9:  [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).
		len = atoi(s + 3);
data/pax-utils-1.2.6/paxinc.c:123:19:  [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).
		s = ar->extfn + atoi(s + 1);
data/pax-utils-1.2.6/paxinc.c:130:13:  [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).
	ret.date = atoi(ret.buf.formatted.date);
data/pax-utils-1.2.6/paxinc.c:131:12:  [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).
	ret.uid = atoi(ret.buf.formatted.uid);
data/pax-utils-1.2.6/paxinc.c:132:12:  [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).
	ret.gid = atoi(ret.buf.formatted.gid);
data/pax-utils-1.2.6/paxinc.c:134:13:  [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).
	ret.size = atoi(ret.buf.formatted.size);
data/pax-utils-1.2.6/paxinc.c:144: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[8];
data/pax-utils-1.2.6/paxinc.h:54: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 name[__PAX_UTILS_PATH_MAX];
data/pax-utils-1.2.6/paxinc.h:62: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 raw[60];
data/pax-utils-1.2.6/paxinc.h:64: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 name[16];
data/pax-utils-1.2.6/paxinc.h:65: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 date[12];
data/pax-utils-1.2.6/paxinc.h:66: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 uid[6];
data/pax-utils-1.2.6/paxinc.h:67: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 gid[6];
data/pax-utils-1.2.6/paxinc.h:68: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 mode[8];
data/pax-utils-1.2.6/paxinc.h:69: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 size[10];
data/pax-utils-1.2.6/paxinc.h:70: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 magic[2];
data/pax-utils-1.2.6/paxldso.c:146: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 magic[LDSO_CACHE_MAGIC_LEN];
data/pax-utils-1.2.6/paxldso.c:147: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 version[LDSO_CACHE_VER_LEN];
data/pax-utils-1.2.6/paxldso.c:212: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(ldso_cache_buf, lib, lib_len);
data/pax-utils-1.2.6/paxldso.c:272:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
				gpath = memcpy(path + 3, "/etc/", 5);
data/pax-utils-1.2.6/paxldso.c:277:16:  [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).
					curr_fd = open(".", O_RDONLY|O_CLOEXEC);
data/pax-utils-1.2.6/paxmacho.c:195: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).
	if ((fd = open(filename, O_RDONLY)) == -1)
data/pax-utils-1.2.6/pspax.c:81: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 str[1024];
data/pax-utils-1.2.6/pspax.c:99: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 str[BUFSIZ];
data/pax-utils-1.2.6/pspax.c:125: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 str[BUFSIZ];
data/pax-utils-1.2.6/pspax.c:161: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 str[BUFSIZ];
data/pax-utils-1.2.6/pspax.c:216: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 str[BUFSIZ];
data/pax-utils-1.2.6/pspax.c:240: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[BUFSIZ];
data/pax-utils-1.2.6/pspax.c:257: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[BUFSIZ];
data/pax-utils-1.2.6/pspax.c:286: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 ret[8];
data/pax-utils-1.2.6/pspax.c:289: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(ret, "--- ---\0", 8);
data/pax-utils-1.2.6/pspax.c:308: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(ret+off, gnu_short_stack_flags(flags), 3); \
data/pax-utils-1.2.6/pspax.c:368:9:  [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).
		pid = atoi(de->d_name);
data/pax-utils-1.2.6/pspax.c:373: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).
		pfd = open(de->d_name, O_RDONLY|O_CLOEXEC|O_PATH|O_DIRECTORY);
data/pax-utils-1.2.6/pspax.c:527:24:  [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 'p': show_pid = atoi(optarg); break;
data/pax-utils-1.2.6/pspax.c:533: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).
			show_uid = atoi(optarg);
data/pax-utils-1.2.6/pspax.c:543: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).
			show_gid = atoi(optarg);
data/pax-utils-1.2.6/scanelf.c:105: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(path, env_path, path_len + 1);
data/pax-utils-1.2.6/scanelf.c:109: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(p + 1, fname, fname_len + 1);
data/pax-utils-1.2.6/scanelf.c:122:4:  [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(ep, fname, fname_len);
data/pax-utils-1.2.6/scanelf.c:124:4:  [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(path + path_len, fname, fname_len);
data/pax-utils-1.2.6/scanelf.c:134:4:  [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(ep, env_path + offset, restore);
data/pax-utils-1.2.6/scanelf.c:363: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 ret[7];
data/pax-utils-1.2.6/scanelf.c:384: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(ret, pax_short_pf_flags(EGET(phdr[i].p_flags)), 6); \
data/pax-utils-1.2.6/scanelf.c:417: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 ret[12];
data/pax-utils-1.2.6/scanelf.c:423: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(ret, "--- --- ---\0", 12);
data/pax-utils-1.2.6/scanelf.c:467:4:  [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(ret+offset, gnu_short_stack_flags(flags), 3); \
data/pax-utils-1.2.6/scanelf.c:510:4:  [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(ret, "!WX", 3); \
data/pax-utils-1.2.6/scanelf.c:936: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[__PAX_UTILS_PATH_MAX] = "";
data/pax-utils-1.2.6/scanelf.c:1284: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[1024];
data/pax-utils-1.2.6/scanelf.c:1479: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 ubuf[sizeof(unsigned long)*2];
data/pax-utils-1.2.6/scanelf.c:1686: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 buf[__PAX_UTILS_PATH_MAX], *subpath;
data/pax-utils-1.2.6/scanelf.c:1733: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(subpath, dentry->d_name, len);
data/pax-utils-1.2.6/scanelf.c:1761:17:  [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).
	else if ((fp = fopen(filename, "r")) == NULL)
data/pax-utils-1.2.6/scanelf.c:2010:17:  [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).
			match_bits = atoi(optarg);
data/pax-utils-1.2.6/scanelf.c:2118:14:  [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).
			root_fd = open(optarg, O_RDONLY|O_CLOEXEC);
data/pax-utils-1.2.6/scanelf.c:2160: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 err[256];
data/pax-utils-1.2.6/scanelf.c:2359: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 buf[__PAX_UTILS_PATH_MAX];
data/pax-utils-1.2.6/scanmacho.c:248: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 ubuf[sizeof(unsigned long)*2];
data/pax-utils-1.2.6/scanmacho.c:352: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 sbuf[128];
data/pax-utils-1.2.6/scanmacho.c:353: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 ftype[32];
data/pax-utils-1.2.6/scanmacho.c:432: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).
	if ((fd = open(filename, O_RDONLY)) == -1)
data/pax-utils-1.2.6/scanmacho.c:449: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 buf[__PAX_UTILS_PATH_MAX];
data/pax-utils-1.2.6/scanmacho.c:498: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 path[__PAX_UTILS_PATH_MAX];
data/pax-utils-1.2.6/scanmacho.c:503:17:  [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).
	else if ((fp = fopen(filename, "r")) == NULL)
data/pax-utils-1.2.6/scanmacho.c:646:17:  [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).
			match_bits = atoi(optarg);
data/pax-utils-1.2.6/security.c:111: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).
		SCMP_SYS(open),
data/pax-utils-1.2.6/security.c:181:12:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
		SCMP_SYS(vfork),
data/pax-utils-1.2.6/security.c:263:8:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
			if (vfork() == 0)
data/pax-utils-1.2.6/security.c:302:8:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
			if (vfork() == 0)
data/pax-utils-1.2.6/xfuncs.c:61: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 my_app[2];
data/pax-utils-1.2.6/xfuncs.c:70: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(ret, src, n);
data/pax-utils-1.2.6/paxelf.c:143:3:  [1] (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 character.
		strcpy(buf, "?");
data/pax-utils-1.2.6/paxinc.c:31:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(ret.fd, buf, AR_MAGIC_SIZE) != AR_MAGIC_SIZE)
data/pax-utils-1.2.6/paxinc.c:68:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(ar->fd, ret.buf.raw, sizeof(ret.buf.raw)) != sizeof(ret.buf.raw))
data/pax-utils-1.2.6/paxinc.c:75:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(ar->fd, ret.buf.raw+59, 1) != 1)
data/pax-utils-1.2.6/paxinc.c:94:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(ar->fd, ar->extfn, len) != len)
data/pax-utils-1.2.6/paxinc.c:109:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(ar->fd, ret.buf.formatted.name, len) != len)
data/pax-utils-1.2.6/paxinc.c:113:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(ar->fd, s, len) != len)
data/pax-utils-1.2.6/paxinc.c:128:25:  [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 ((s=strchr(ret.name+strlen(ar->filename), '/')) != NULL)
data/pax-utils-1.2.6/paxldso.c:207: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).
		lib_len = strlen(lib) + 1;
data/pax-utils-1.2.6/pspax.c:114: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).
		str[strlen(str) - 1] = '\0';
data/pax-utils-1.2.6/pspax.c:133: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(p) < 6)
data/pax-utils-1.2.6/pspax.c:169: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(p) < 6)
data/pax-utils-1.2.6/pspax.c:221: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).
	len = strlen(name);
data/pax-utils-1.2.6/pspax.c:227: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).
			str[strlen(str) - 1] = 0;
data/pax-utils-1.2.6/pspax.c:419:14:  [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 (pwd && strlen(pwd->pw_name) >= 8)
data/pax-utils-1.2.6/scanelf.c:102: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).
	path_len = strlen(env_path);
data/pax-utils-1.2.6/scanelf.c:103:14:  [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).
	fname_len = strlen(fname);
data/pax-utils-1.2.6/scanelf.c:832:14:  [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).
				offset = strlen(*r); \
data/pax-utils-1.2.6/scanelf.c:844:43:  [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).
					len = (end ? (size_t)(end - start) : strlen(start)); \
data/pax-utils-1.2.6/scanelf.c:883: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).
					tmpdir_len = strlen(tmpdir); \
data/pax-utils-1.2.6/scanelf.c:888:14:  [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).
							len = strlen(end); \
data/pax-utils-1.2.6/scanelf.c:1276: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).
				const size_t len = strlen(this_sym);
data/pax-utils-1.2.6/scanelf.c:1404:65:  [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).
#define prints(str) ({ ssize_t ret = write(fileno(stdout), str, strlen(str)); ret; })
data/pax-utils-1.2.6/scanelf.c:1503:26:  [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).
				ssize_t len_search = strlen(search_path);
data/pax-utils-1.2.6/scanelf.c:1504: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).
				ssize_t len_file = strlen(elf->filename);
data/pax-utils-1.2.6/scanelf.c:1727:9:  [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).
		len = strlen(dentry->d_name);
data/pax-utils-1.2.6/scanelf.c:1926: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).
	size_t a_arg_len = strlen(a_arg) + 2;
data/pax-utils-1.2.6/scanelf.c:1936:11:  [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 l = strlen(long_opts[i].name);
data/pax-utils-1.2.6/scanelf.c:1954:20:  [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)(optlen - strlen(long_opts[i].name) - a_arg_len), "");
data/pax-utils-1.2.6/scanelf.c:2049:20:  [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).
			for (x = 0; x < strlen(optarg); x++) {
data/pax-utils-1.2.6/scanmacho.c:118: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(!g_match ? needed : find_lib)))
data/pax-utils-1.2.6/scanmacho.c:185:65:  [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).
#define prints(str) ({ ssize_t ret = write(fileno(stdout), str, strlen(str)); ret; })
data/pax-utils-1.2.6/scanmacho.c:272:26:  [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).
				ssize_t len_search = strlen(search_path);
data/pax-utils-1.2.6/scanmacho.c:273: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).
				ssize_t len_file = strlen(fobj->filename);
data/pax-utils-1.2.6/scanmacho.c:470: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).
	pathlen = strlen(path);
data/pax-utils-1.2.6/scanmacho.c:474: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).
		len = (pathlen + 1 + strlen(dentry->d_name) + 1);
data/pax-utils-1.2.6/security.c:125:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		SCMP_SYS(read),
data/pax-utils-1.2.6/xfuncs.c:43: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).
	new_len = (init ? 0 : strlen(*dst)) + strlen(src);
data/pax-utils-1.2.6/xfuncs.c:43:40:  [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).
	new_len = (init ? 0 : strlen(*dst)) + strlen(src);
data/pax-utils-1.2.6/xfuncs.c:54:3:  [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(*dst, src, n);
data/pax-utils-1.2.6/xfuncs.h:27:55:  [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).
#define xarraypush_str(arr, ele) xarraypush(arr, ele, strlen(ele) + 1 /*NUL*/)

ANALYSIS SUMMARY:

Hits = 151
Lines analyzed = 11008 in approximately 0.35 seconds (31568 lines/second)
Physical Source Lines of Code (SLOC) = 8758
Hits@level = [0] 186 [1]  41 [2]  87 [3]  11 [4]  11 [5]   1
Hits@level+ = [0+] 337 [1+] 151 [2+] 110 [3+]  23 [4+]  12 [5+]   1
Hits/KSLOC@level+ = [0+] 38.4791 [1+] 17.2414 [2+] 12.5599 [3+] 2.62617 [4+] 1.37018 [5+] 0.114181
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.