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/libselinux-3.1/include/selinux/avc.h
Examining data/libselinux-3.1/include/selinux/context.h
Examining data/libselinux-3.1/include/selinux/get_context_list.h
Examining data/libselinux-3.1/include/selinux/get_default_type.h
Examining data/libselinux-3.1/include/selinux/label.h
Examining data/libselinux-3.1/include/selinux/restorecon.h
Examining data/libselinux-3.1/include/selinux/selinux.h
Examining data/libselinux-3.1/man/man3/security_validatetrans.c
Examining data/libselinux-3.1/man/man3/security_validatetrans_raw.c
Examining data/libselinux-3.1/src/audit2why.c
Examining data/libselinux-3.1/src/avc.c
Examining data/libselinux-3.1/src/avc_internal.c
Examining data/libselinux-3.1/src/avc_internal.h
Examining data/libselinux-3.1/src/avc_sidtab.c
Examining data/libselinux-3.1/src/avc_sidtab.h
Examining data/libselinux-3.1/src/booleans.c
Examining data/libselinux-3.1/src/callbacks.c
Examining data/libselinux-3.1/src/callbacks.h
Examining data/libselinux-3.1/src/canonicalize_context.c
Examining data/libselinux-3.1/src/checkAccess.c
Examining data/libselinux-3.1/src/check_context.c
Examining data/libselinux-3.1/src/checkreqprot.c
Examining data/libselinux-3.1/src/compute_av.c
Examining data/libselinux-3.1/src/compute_create.c
Examining data/libselinux-3.1/src/compute_member.c
Examining data/libselinux-3.1/src/compute_relabel.c
Examining data/libselinux-3.1/src/compute_user.c
Examining data/libselinux-3.1/src/context.c
Examining data/libselinux-3.1/src/context_internal.h
Examining data/libselinux-3.1/src/deny_unknown.c
Examining data/libselinux-3.1/src/disable.c
Examining data/libselinux-3.1/src/enabled.c
Examining data/libselinux-3.1/src/fgetfilecon.c
Examining data/libselinux-3.1/src/file_path_suffixes.h
Examining data/libselinux-3.1/src/freecon.c
Examining data/libselinux-3.1/src/freeconary.c
Examining data/libselinux-3.1/src/fsetfilecon.c
Examining data/libselinux-3.1/src/get_context_list.c
Examining data/libselinux-3.1/src/get_context_list_internal.h
Examining data/libselinux-3.1/src/get_default_type.c
Examining data/libselinux-3.1/src/get_default_type_internal.h
Examining data/libselinux-3.1/src/get_initial_context.c
Examining data/libselinux-3.1/src/getenforce.c
Examining data/libselinux-3.1/src/getfilecon.c
Examining data/libselinux-3.1/src/getpeercon.c
Examining data/libselinux-3.1/src/init.c
Examining data/libselinux-3.1/src/is_customizable_type.c
Examining data/libselinux-3.1/src/label.c
Examining data/libselinux-3.1/src/label_backends_android.c
Examining data/libselinux-3.1/src/label_db.c
Examining data/libselinux-3.1/src/label_file.c
Examining data/libselinux-3.1/src/label_file.h
Examining data/libselinux-3.1/src/label_internal.h
Examining data/libselinux-3.1/src/label_media.c
Examining data/libselinux-3.1/src/label_support.c
Examining data/libselinux-3.1/src/label_x.c
Examining data/libselinux-3.1/src/lgetfilecon.c
Examining data/libselinux-3.1/src/load_policy.c
Examining data/libselinux-3.1/src/lsetfilecon.c
Examining data/libselinux-3.1/src/mapping.c
Examining data/libselinux-3.1/src/mapping.h
Examining data/libselinux-3.1/src/matchmediacon.c
Examining data/libselinux-3.1/src/matchpathcon.c
Examining data/libselinux-3.1/src/policy.h
Examining data/libselinux-3.1/src/policyvers.c
Examining data/libselinux-3.1/src/procattr.c
Examining data/libselinux-3.1/src/query_user_context.c
Examining data/libselinux-3.1/src/regex.c
Examining data/libselinux-3.1/src/regex.h
Examining data/libselinux-3.1/src/reject_unknown.c
Examining data/libselinux-3.1/src/selinux_check_securetty_context.c
Examining data/libselinux-3.1/src/selinux_config.c
Examining data/libselinux-3.1/src/selinux_internal.h
Examining data/libselinux-3.1/src/selinux_netlink.h
Examining data/libselinux-3.1/src/selinux_restorecon.c
Examining data/libselinux-3.1/src/sestatus.c
Examining data/libselinux-3.1/src/setenforce.c
Examining data/libselinux-3.1/src/setexecfilecon.c
Examining data/libselinux-3.1/src/setfilecon.c
Examining data/libselinux-3.1/src/setrans_client.c
Examining data/libselinux-3.1/src/setrans_internal.h
Examining data/libselinux-3.1/src/seusers.c
Examining data/libselinux-3.1/src/sha1.c
Examining data/libselinux-3.1/src/sha1.h
Examining data/libselinux-3.1/src/stringrep.c
Examining data/libselinux-3.1/src/validatetrans.c
Examining data/libselinux-3.1/utils/avcstat.c
Examining data/libselinux-3.1/utils/compute_av.c
Examining data/libselinux-3.1/utils/compute_create.c
Examining data/libselinux-3.1/utils/compute_member.c
Examining data/libselinux-3.1/utils/compute_relabel.c
Examining data/libselinux-3.1/utils/getconlist.c
Examining data/libselinux-3.1/utils/getdefaultcon.c
Examining data/libselinux-3.1/utils/getenforce.c
Examining data/libselinux-3.1/utils/getfilecon.c
Examining data/libselinux-3.1/utils/getpidcon.c
Examining data/libselinux-3.1/utils/getsebool.c
Examining data/libselinux-3.1/utils/getseuser.c
Examining data/libselinux-3.1/utils/matchpathcon.c
Examining data/libselinux-3.1/utils/policyvers.c
Examining data/libselinux-3.1/utils/sefcontext_compile.c
Examining data/libselinux-3.1/utils/selabel_digest.c
Examining data/libselinux-3.1/utils/selabel_get_digests_all_partial_matches.c
Examining data/libselinux-3.1/utils/selabel_lookup.c
Examining data/libselinux-3.1/utils/selabel_lookup_best_match.c
Examining data/libselinux-3.1/utils/selabel_partial_match.c
Examining data/libselinux-3.1/utils/selinux_check_access.c
Examining data/libselinux-3.1/utils/selinux_check_securetty_context.c
Examining data/libselinux-3.1/utils/selinuxenabled.c
Examining data/libselinux-3.1/utils/selinuxexeccon.c
Examining data/libselinux-3.1/utils/setenforce.c
Examining data/libselinux-3.1/utils/setfilecon.c
Examining data/libselinux-3.1/utils/togglesebool.c
Examining data/libselinux-3.1/utils/validatetrans.c

FINAL RESULTS:

data/libselinux-3.1/include/selinux/avc.h:143:24:  [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.
__attribute__ ((format(printf, 1, 2)))
data/libselinux-3.1/include/selinux/selinux.h:156:24:  [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.
__attribute__ ((format(printf, 2, 3)))
data/libselinux-3.1/src/avc_internal.h:22:75:  [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.
extern void (*avc_func_log) (const char *, ...) __attribute__((__format__(printf,1,2))) ;
data/libselinux-3.1/src/avc_internal.h:152:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  snprintf(buf+strlen(buf), AVC_AUDIT_BUFSIZE-strlen(buf), format)
data/libselinux-3.1/src/callbacks.c:14:35:  [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.
static int __attribute__ ((format(printf, 2, 3)))
data/libselinux-3.1/src/callbacks.c:20:7:  [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.
	rc = vfprintf(stderr, fmt, ap);
data/libselinux-3.1/src/callbacks.c:58:28:  [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.
int __attribute__ ((format(printf, 2, 3)))
data/libselinux-3.1/src/callbacks.h:14:35:  [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.
extern int __attribute__ ((format(printf, 2, 3)))
data/libselinux-3.1/src/context.c:164: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(t, str);
data/libselinux-3.1/src/get_default_type.c:68:2:  [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(t, ptr);
data/libselinux-3.1/src/init.c:152:24:  [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.
	has_selinux_config = (access(SELINUXCONFIG, F_OK) == 0);
data/libselinux-3.1/src/label_file.c:442:2:  [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(to, suffix);
data/libselinux-3.1/src/label_file.c:496:4:  [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(save_path, path);
data/libselinux-3.1/src/label_file.c:516:4:  [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(save_path, path);
data/libselinux-3.1/src/label_file.c:893: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(clean_key + sofar, prev_slash);
data/libselinux-3.1/src/label_internal.h:128:36:  [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.
extern void __attribute__ ((format(printf, 1, 2)))
data/libselinux-3.1/src/matchpathcon.c:15:28:  [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.
    __attribute__ ((format(printf, 1, 2)))
data/libselinux-3.1/src/matchpathcon.c:21:2:  [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, ap);
data/libselinux-3.1/src/matchpathcon.c:27:28:  [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.
    __attribute__ ((format(printf, 1, 2)))
data/libselinux-3.1/src/matchpathcon.c:215: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(fl->file, file);
data/libselinux-3.1/src/matchpathcon.c:232:4:  [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(fl->file, file);
data/libselinux-3.1/src/matchpathcon.c:248:2:  [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(fl->file, file);
data/libselinux-3.1/src/matchpathcon.c:429:2:  [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(resolved_path, last_component);
data/libselinux-3.1/src/selinux_config.c:343: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(policy_path, F_OK) == 0 ) {
data/libselinux-3.1/src/selinux_config.c:352:17:  [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.
	} while ((rc = access(policy_path, F_OK)) && --vers > 0);
data/libselinux-3.1/src/setrans_client.c:282:17:  [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.
	has_setrans = (access(SETRANS_UNIX_SOCKET, F_OK) == 0);
data/libselinux-3.1/src/stringrep.c:308:12:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
				ptr += sprintf(ptr, "%s ", str);
data/libselinux-3.1/utils/avcstat.c:46:34:  [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.
static __attribute__((__format__(printf,1,2),__noreturn__)) void die(const char *msg, ...)
data/libselinux-3.1/utils/avcstat.c:53:2:  [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, msg, args);
data/libselinux-3.1/utils/sefcontext_compile.c:417:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	rc = sprintf(tmp, "%sXXXXXX", stack_path);
data/libselinux-3.1/utils/selabel_digest.c:35:7:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	fp = popen(cmd, "r");
data/libselinux-3.1/utils/selabel_digest.c:176:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(cmd_ptr, "%s ", specfiles[i]);
data/libselinux-3.1/utils/selabel_lookup_best_match.c:110:4:  [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(links[num_links], argv[i]);
data/libselinux-3.1/src/matchpathcon.c:404:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
		p = realpath(tmp_path, resolved_path);
data/libselinux-3.1/src/matchpathcon.c:407:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
		p = realpath("./", resolved_path);
data/libselinux-3.1/src/matchpathcon.c:446:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
		p = realpath(path, stackpath);
data/libselinux-3.1/src/matchpathcon.c:510:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
		p = realpath(path, stackpath);
data/libselinux-3.1/src/selinux_restorecon.c:889:15:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
			pathname = realpath(pathname_orig, NULL);
data/libselinux-3.1/src/selinux_restorecon.c:901:17:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
			pathdnamer = realpath(pathdname, NULL);
data/libselinux-3.1/utils/avcstat.c:107:14:  [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.
	while ((i = getopt(argc, argv, "cf:h?-")) != -1) {
data/libselinux-3.1/utils/getconlist.c:26:16:  [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.
	while ((opt = getopt(argc, argv, "l:")) > 0) {
data/libselinux-3.1/utils/getdefaultcon.c:28:16:  [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.
	while ((opt = getopt(argc, argv, "l:r:s:v")) > 0) {
data/libselinux-3.1/utils/getsebool.c:20:16:  [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.
	while ((opt = getopt(argc, argv, "a")) > 0) {
data/libselinux-3.1/utils/matchpathcon.c:82:16:  [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.
	while ((opt = getopt(argc, argv, "m:Nnf:P:p:Vq")) > 0) {
data/libselinux-3.1/utils/sefcontext_compile.c:311:16:  [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.
	while ((opt = getopt(argc, argv, "io:p:r")) > 0) {
data/libselinux-3.1/utils/selabel_digest.c:82:16:  [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.
	while ((opt = getopt(argc, argv, "ib:Bvf:")) > 0) {
data/libselinux-3.1/utils/selabel_get_digests_all_partial_matches.c:51:16:  [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.
	while ((opt = getopt(argc, argv, "f:rv")) > 0) {
data/libselinux-3.1/utils/selabel_lookup.c:47:16:  [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.
	while ((opt = getopt(argc, argv, "b:f:vrk:t:")) > 0) {
data/libselinux-3.1/utils/selabel_lookup_best_match.c:69:16:  [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.
	while ((opt = getopt(argc, argv, "f:vrp:m:")) > 0) {
data/libselinux-3.1/utils/selabel_partial_match.c:42:16:  [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.
	while ((opt = getopt(argc, argv, "f:vp:")) > 0) {
data/libselinux-3.1/utils/selinux_check_access.c:28:16:  [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.
	while ((opt = getopt(argc, argv, "a:")) != -1) {
data/libselinux-3.1/include/selinux/selinux.h:387: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.
	const char *perms[sizeof(access_vector_t) * 8 + 1];
data/libselinux-3.1/src/audit2why.c:66: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 errormsg[PATH_MAX];
data/libselinux-3.1/src/audit2why.c:195: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[PATH_MAX];
data/libselinux-3.1/src/audit2why.c:196: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 errormsg[PATH_MAX+1024+20];
data/libselinux-3.1/src/audit2why.c:204:8:  [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).
		fp = fopen(path, "re");
data/libselinux-3.1/src/audit2why.c:221:8:  [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).
		fp = fopen(curpolicy, "re");
data/libselinux-3.1/src/avc.c:260: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, &cache_stats, sizeof(cache_stats));
data/libselinux-3.1/src/avc.c:495: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(&node->ae.avd, &ae->avd, sizeof(ae->avd));
data/libselinux-3.1/src/avc.c:814: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(avd, &ae->avd, sizeof(*avd));
data/libselinux-3.1/src/avc_internal.c:50:1:  [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 avc_prefix[AVC_PREFIX_SIZE] = "uavc";
data/libselinux-3.1/src/avc_internal.c:229: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[1024] __attribute__ ((aligned));
data/libselinux-3.1/src/avc_internal.c:256: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[1024] __attribute__ ((aligned));
data/libselinux-3.1/src/avc_internal.h:63: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.
extern char avc_prefix[AVC_PREFIX_SIZE] ;
data/libselinux-3.1/src/booleans.c:41: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[PATH_MAX];
data/libselinux-3.1/src/booleans.c:103:8:  [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).
	cfg = fopen(selinux_booleans_subs_path(), "re");
data/libselinux-3.1/src/booleans.c:171: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(fname, flag);
data/libselinux-3.1/src/booleans.c:191: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(fname, flag);
data/libselinux-3.1/src/booleans.c:241:6:  [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(&buf[1]))
data/libselinux-3.1/src/booleans.c:258:6:  [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(buf))
data/libselinux-3.1/src/booleans.c:269: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[2];
data/libselinux-3.1/src/booleans.c:302: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[2];
data/libselinux-3.1/src/booleans.c:303: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[PATH_MAX];
data/libselinux-3.1/src/booleans.c:311: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(path, O_WRONLY | O_CLOEXEC);
data/libselinux-3.1/src/canonicalize_context.c:15: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[PATH_MAX];
data/libselinux-3.1/src/canonicalize_context.c:26: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(path, O_RDWR | O_CLOEXEC);
data/libselinux-3.1/src/check_context.c:14: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[PATH_MAX];
data/libselinux-3.1/src/check_context.c:23: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(path, O_RDWR | O_CLOEXEC);
data/libselinux-3.1/src/checkreqprot.c:15: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[PATH_MAX];
data/libselinux-3.1/src/checkreqprot.c:16: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[20];
data/libselinux-3.1/src/checkreqprot.c:24: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/compute_av.c:19: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[PATH_MAX];
data/libselinux-3.1/src/compute_av.c:31: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(path, O_RDWR | O_CLOEXEC);
data/libselinux-3.1/src/compute_create.c:57: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[PATH_MAX];
data/libselinux-3.1/src/compute_create.c:68: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(path, O_RDWR | O_CLOEXEC);
data/libselinux-3.1/src/compute_member.c:18: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[PATH_MAX];
data/libselinux-3.1/src/compute_member.c:29: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(path, O_RDWR | O_CLOEXEC);
data/libselinux-3.1/src/compute_relabel.c:18: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[PATH_MAX];
data/libselinux-3.1/src/compute_relabel.c:29: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(path, O_RDWR | O_CLOEXEC);
data/libselinux-3.1/src/compute_user.c:16: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[PATH_MAX];
data/libselinux-3.1/src/compute_user.c:31: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(path, O_RDWR | O_CLOEXEC);
data/libselinux-3.1/src/context.c:14: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 *(component[4]);
data/libselinux-3.1/src/deny_unknown.c:15: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[PATH_MAX];
data/libselinux-3.1/src/deny_unknown.c:16: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[20];
data/libselinux-3.1/src/deny_unknown.c:24: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/disable.c:15: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[PATH_MAX];
data/libselinux-3.1/src/disable.c:16: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[20];
data/libselinux-3.1/src/disable.c:24: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(path, O_WRONLY | O_CLOEXEC);
data/libselinux-3.1/src/enabled.c:31: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[20], path[PATH_MAX];
data/libselinux-3.1/src/enabled.c:38: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/get_context_list.c:304: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[255], *ptr;
data/libselinux-3.1/src/get_context_list.c:308:7:  [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).
	fp = fopen(selinux_failsafe_context_path(), "re");
data/libselinux-3.1/src/get_context_list.c:434:7:  [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).
	fp = fopen(fname, "re");
data/libselinux-3.1/src/get_context_list.c:448:7:  [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).
	fp = fopen(selinux_default_context_path(), "re");
data/libselinux-3.1/src/get_default_type.c:14:7:  [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).
	fp = fopen(selinux_default_type_path(), "re");
data/libselinux-3.1/src/get_default_type.c:29: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[250];
data/libselinux-3.1/src/get_initial_context.c:16: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[PATH_MAX];
data/libselinux-3.1/src/get_initial_context.c:28: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/getenforce.c:15: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[PATH_MAX];
data/libselinux-3.1/src/getenforce.c:16: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[20];
data/libselinux-3.1/src/getenforce.c:24: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/init.c:63:7:  [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).
	fp = fopen("/proc/filesystems", "re");
data/libselinux-3.1/src/init.c:102:7:  [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).
	fp = fopen("/proc/mounts", "re");
data/libselinux-3.1/src/is_customizable_type.c:19:7:  [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).
	fp = fopen(selinux_customizable_types_path(), "re");
data/libselinux-3.1/src/label_backends_android.c:145: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 line_buf[BUFSIZ];
data/libselinux-3.1/src/label_backends_android.c:162: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 ((fp = fopen(path, "re")) == NULL)
data/libselinux-3.1/src/label_db.c:280:14:  [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 ((filp = fopen(path, "rb")) == NULL) {
data/libselinux-3.1/src/label_file.c:464: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 stack_path[len];
data/libselinux-3.1/src/label_file.c:525: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(sb, &found->sb, sizeof(*sb));
data/libselinux-3.1/src/label_file.c:526:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	return fopen(save_path, "re");
data/libselinux-3.1/src/label_file.c:537: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 found_path[PATH_MAX];
data/libselinux-3.1/src/label_file.c:605: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[1024];
data/libselinux-3.1/src/label_file.c:606:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	FILE *cfg = fopen(path, "re");
data/libselinux-3.1/src/label_file.c:732: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 subs_file[PATH_MAX + 1];
data/libselinux-3.1/src/label_file.c:888: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(clean_key + sofar, prev_slash, next_slash - prev_slash);
data/libselinux-3.1/src/label_file.c:1008: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(*xattr_digest, read_digest, SHA1_HASH_SIZE);
data/libselinux-3.1/src/label_file.c:1016: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(*calculated_digest, hash_digest, SHA1_HASH_SIZE);
data/libselinux-3.1/src/label_file.c:1055: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(digest, sha1_hash.bytes, SHA1_HASH_SIZE);
data/libselinux-3.1/src/label_file.h:216: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(&spec_copy[front++], &data->spec_arr[i], len);
data/libselinux-3.1/src/label_file.h:218: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(&spec_copy[back--], &data->spec_arr[i], len);
data/libselinux-3.1/src/label_file.h:229: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(&spec, &spec_copy[front], len);
data/libselinux-3.1/src/label_file.h:231: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(&spec_copy[front], &spec_copy[back], len);
data/libselinux-3.1/src/label_file.h:233: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(&spec_copy[back], &spec, len);
data/libselinux-3.1/src/label_file.h:336: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(buf, fp->next_addr, bytes);
data/libselinux-3.1/src/label_file.h:347: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 regex_error_format_buffer[256];
data/libselinux-3.1/src/label_file.h:397: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(cp, reg_buf, len);
data/libselinux-3.1/src/label_media.c:93: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 ((fp = fopen(path, "re")) == NULL)
data/libselinux-3.1/src/label_support.c:174: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.
		tmp_buf = memcpy(digest->hashbuf +
data/libselinux-3.1/src/label_x.c:120: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 ((fp = fopen(path, "re")) == NULL)
data/libselinux-3.1/src/load_policy.c:28: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[PATH_MAX];
data/libselinux-3.1/src/load_policy.c:37: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(path, O_RDWR | O_CLOEXEC);
data/libselinux-3.1/src/load_policy.c:57: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[PATH_MAX];
data/libselinux-3.1/src/load_policy.c:130: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/load_policy.c:136: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/load_policy.c:245:8:  [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).
	cfg = fopen("/proc/cmdline", "re");
data/libselinux-3.1/src/load_policy.c:257: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).
				    atoi(tmp + sizeof("enforcing=") - 1);
data/libselinux-3.1/src/matchmediacon.c:20: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 current_line[PATH_MAX];
data/libselinux-3.1/src/matchmediacon.c:21:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((infile = fopen(path, "re")) == NULL)
data/libselinux-3.1/src/matchpathcon.c:437: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 stackpath[PATH_MAX + 1];
data/libselinux-3.1/src/matchpathcon.c:503: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 stackpath[PATH_MAX + 1];
data/libselinux-3.1/src/policyvers.c:15: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[PATH_MAX];
data/libselinux-3.1/src/policyvers.c:16: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[20];
data/libselinux-3.1/src/policyvers.c:25: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/procattr.c:93: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(path, flags | O_CLOEXEC);
data/libselinux-3.1/src/procattr.c:106: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(path, flags | O_CLOEXEC);
data/libselinux-3.1/src/query_user_context.c:16: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 response[10];	/* string to hold the user's response */
data/libselinux-3.1/src/query_user_context.c:40: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 response[10];	/* The user's response                        */
data/libselinux-3.1/src/query_user_context.c:108: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 response[10];	/* Used to get yes or no answers from user */
data/libselinux-3.1/src/query_user_context.c:109: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 role[100];		/* The role requested by the user          */
data/libselinux-3.1/src/query_user_context.c:111: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 type[100];		/* The type requested by the user          */
data/libselinux-3.1/src/query_user_context.c:113: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 level[100];	/* The level requested by the user         */
data/libselinux-3.1/src/regex.c:35: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 arch_string_buffer[32];
data/libselinux-3.1/src/regex.c:102: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 version_buf[256];
data/libselinux-3.1/src/reject_unknown.c:15: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[PATH_MAX];
data/libselinux-3.1/src/reject_unknown.c:16: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[20];
data/libselinux-3.1/src/reject_unknown.c:24: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/selinux_check_securetty_context.c:17:7:  [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).
	fp = fopen(selinux_securetty_types_path(), "re");
data/libselinux-3.1/src/selinux_config.c:63: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 *file_paths[NEL];
data/libselinux-3.1/src/selinux_config.c:68:18:  [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.
#define S_(n, s) char L1(__LINE__)[sizeof(s)];
data/libselinux-3.1/src/selinux_config.c:72: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 str[0];
data/libselinux-3.1/src/selinux_config.c:92:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	FILE *cfg = fopen(SELINUXCONFIG, "re");
data/libselinux-3.1/src/selinux_config.c:165:7:  [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).
	fp = fopen(SELINUXCONFIG, "re");
data/libselinux-3.1/src/selinux_config.c:203: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).
				*intptr = atoi(value);
data/libselinux-3.1/src/selinux_config.c:339: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 policy_path[PATH_MAX];
data/libselinux-3.1/src/selinux_restorecon.c:235: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 *mount_info[4];
data/libselinux-3.1/src/selinux_restorecon.c:244:7:  [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).
	fp = fopen("/proc/mounts", "re");
data/libselinux-3.1/src/selinux_restorecon.c:327: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((&sha1_buf[i * 2]), "%02x", xattr_digest[i]);
data/libselinux-3.1/src/selinux_restorecon.c:791: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((*new_node)->digest, calculated_digest, digest_len);
data/libselinux-3.1/src/selinux_restorecon.c:856: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 *paths[2] = { NULL, NULL };
data/libselinux-3.1/src/selinux_restorecon.c:1261: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 *paths[2] = { NULL, NULL };
data/libselinux-3.1/src/sestatus.c:260: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[PATH_MAX];
data/libselinux-3.1/src/sestatus.c:273: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/setenforce.c:15: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[PATH_MAX];
data/libselinux-3.1/src/setenforce.c:16: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[20];
data/libselinux-3.1/src/setenforce.c:24: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(path, O_RDWR | O_CLOEXEC);
data/libselinux-3.1/src/seusers.c:188:8:  [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).
	cfg = fopen(selinux_usersconf_path(), "re");
data/libselinux-3.1/src/seusers.c:281:7:  [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).
	fp = fopen(path, "re");
data/libselinux-3.1/src/sha1.c:80:5:  [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(block, buffer, 64);
data/libselinux-3.1/src/sha1.c:171:9:  [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(&Context->Buffer[j], Buffer, i);
data/libselinux-3.1/src/sha1.c:184:5:  [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(&Context->Buffer[j], &((uint8_t*)Buffer)[i], BufferSize - i);
data/libselinux-3.1/src/stringrep.c:53: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[PATH_MAX];
data/libselinux-3.1/src/stringrep.c: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 buf[20];
data/libselinux-3.1/src/stringrep.c:83: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/stringrep.c:108: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(path, O_RDONLY | O_CLOEXEC);
data/libselinux-3.1/src/stringrep.c:299: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(ptr, "null");
data/libselinux-3.1/src/stringrep.c:303:9:  [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.
	ptr += sprintf(ptr, "{ ");
data/libselinux-3.1/src/validatetrans.c:18: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[PATH_MAX];
data/libselinux-3.1/src/validatetrans.c:29: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(path, O_WRONLY | O_CLOEXEC);
data/libselinux-3.1/utils/avcstat.c:41: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 buf[DEF_BUF_SIZE];
data/libselinux-3.1/utils/avcstat.c:100: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 avcstatfile[PATH_MAX];
data/libselinux-3.1/utils/avcstat.c:150: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(avcstatfile, O_RDONLY);
data/libselinux-3.1/utils/sefcontext_compile.c:41: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).
	context_file = fopen(filename, "r");
data/libselinux-3.1/utils/sefcontext_compile.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 stack_path[PATH_MAX + 1];
data/libselinux-3.1/utils/sefcontext_compile.c:342:15:  [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).
		policy_fp = fopen(policy_file, "r");
data/libselinux-3.1/utils/sefcontext_compile.c:423:8:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	fd  = mkstemp(tmp);
data/libselinux-3.1/utils/selabel_digest.c:31: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 files_digest[128];
data/libselinux-3.1/utils/selabel_digest.c:68: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 cmd_buf[4096];
data/libselinux-3.1/utils/selabel_digest.c:165: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(&(sha1_buf[i * 2]), "%02x", sha1_digest[i]);
data/libselinux-3.1/utils/selabel_digest.c:172: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(cmd_ptr, "/usr/bin/cat ");
data/libselinux-3.1/utils/selabel_digest.c:180: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(cmd_ptr, "| /usr/bin/openssl dgst -sha1 -hex");
data/libselinux-3.1/utils/selabel_get_digests_all_partial_matches.c:37: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 *paths[2] = { NULL, NULL };
data/libselinux-3.1/utils/selabel_get_digests_all_partial_matches.c:121: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((&sha1_buf[i * 2]),
data/libselinux-3.1/utils/selabel_get_digests_all_partial_matches.c:138:6:  [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((&sha1_buf[i * 2]), "%02x",
data/libselinux-3.1/utils/selabel_get_digests_all_partial_matches.c:147: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((&sha1_buf[i * 2]),
data/libselinux-3.1/utils/selabel_lookup.c:81:11:  [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).
			type = atoi(optarg);
data/libselinux-3.1/utils/setenforce.c:28: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).
		rc = security_setenforce(atoi(argv[1]));
data/libselinux-3.1/src/audit2why.c:203:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(path, init_path, PATH_MAX-1);
data/libselinux-3.1/src/audit2why.c:339:34:  [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).
	rc = sepol_context_to_sid(scon, strlen(scon) + 1, &ssid);
data/libselinux-3.1/src/audit2why.c:343:34:  [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).
	rc = sepol_context_to_sid(tcon, strlen(tcon) + 1, &tsid);
data/libselinux-3.1/src/avc.c:161:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(avc_prefix, prefix, AVC_PREFIX_SIZE - 1);
data/libselinux-3.1/src/avc.c:727:45:  [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).
	avc_suppl_audit(a, tclass, avc_audit_buf + strlen(avc_audit_buf),
data/libselinux-3.1/src/avc.c:728: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).
			AVC_AUDIT_BUFSIZE - strlen(avc_audit_buf));
data/libselinux-3.1/src/avc_internal.h:152: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).
  snprintf(buf+strlen(buf), AVC_AUDIT_BUFSIZE-strlen(buf), format)
data/libselinux-3.1/src/avc_internal.h:152: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).
  snprintf(buf+strlen(buf), AVC_AUDIT_BUFSIZE-strlen(buf), format)
data/libselinux-3.1/src/avc_sidtab.c:24: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).
	size = strlen(keyp);
data/libselinux-3.1/src/booleans.c:161: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) + strlen(selinux_mnt) + sizeof(SELINUX_BOOL_DIR);
data/libselinux-3.1/src/booleans.c:161:23:  [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) + strlen(selinux_mnt) + sizeof(SELINUX_BOOL_DIR);
data/libselinux-3.1/src/booleans.c:180: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(alt_name) + strlen(selinux_mnt) + sizeof(SELINUX_BOOL_DIR);
data/libselinux-3.1/src/booleans.c:180:27:  [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(alt_name) + strlen(selinux_mnt) + sizeof(SELINUX_BOOL_DIR);
data/libselinux-3.1/src/booleans.c:220:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	len = read(fd, *buf, STRBUF_SIZE);
data/libselinux-3.1/src/canonicalize_context.c:36:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(buf, con, size);
data/libselinux-3.1/src/canonicalize_context.c:38:23:  [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).
	ret = write(fd, buf, strlen(buf) + 1);
data/libselinux-3.1/src/canonicalize_context.c:43:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, size - 1);
data/libselinux-3.1/src/canonicalize_context.c:47:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(buf, con, size);
data/libselinux-3.1/src/check_context.c:27:23:  [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).
	ret = write(fd, con, strlen(con) + 1);
data/libselinux-3.1/src/checkreqprot.c:29:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, sizeof(buf) - 1);
data/libselinux-3.1/src/compute_av.c:46:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/libselinux-3.1/src/compute_av.c:51:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, len - 1);
data/libselinux-3.1/src/compute_create.c:87:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/libselinux-3.1/src/compute_create.c:92:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, size - 1);
data/libselinux-3.1/src/compute_member.c:41:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/libselinux-3.1/src/compute_member.c:46:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, size - 1);
data/libselinux-3.1/src/compute_relabel.c:41:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/libselinux-3.1/src/compute_relabel.c:46:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, size - 1);
data/libselinux-3.1/src/compute_user.c:43:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/libselinux-3.1/src/compute_user.c:48:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, size - 1);
data/libselinux-3.1/src/compute_user.c:63: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).
	ptr = buf + strlen(buf) + 1;
data/libselinux-3.1/src/compute_user.c:71:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		ptr += strlen(ptr) + 1;
data/libselinux-3.1/src/context.c:74:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(n->component[i], tok, p - tok);
data/libselinux-3.1/src/context.c:127: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).
			total += strlen(n->component[i]) + 1;
data/libselinux-3.1/src/context.c:152: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).
		t = (char *)malloc(strlen(str) + 1);
data/libselinux-3.1/src/deny_unknown.c:29:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, sizeof(buf) - 1);
data/libselinux-3.1/src/disable.c:30:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/libselinux-3.1/src/enabled.c:45:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(fd, buf, sizeof buf - 1);
data/libselinux-3.1/src/fgetfilecon.c:68:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		return strlen(*context) + 1;
data/libselinux-3.1/src/fsetfilecon.c:12:54:  [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 rc = fsetxattr(fd, XATTR_NAME_SELINUX, context, strlen(context) + 1,
data/libselinux-3.1/src/get_context_list.c:139: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).
	size_t user_len = strlen(user);
data/libselinux-3.1/src/get_context_list.c:225: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).
		if (SIZE_MAX - user_len < strlen(start) + 2) {
data/libselinux-3.1/src/get_context_list.c:231:28:  [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).
		usercon_len = user_len + strlen(start) + 2;
data/libselinux-3.1/src/get_context_list.c:317: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).
	plen = strlen(ptr);
data/libselinux-3.1/src/get_context_list.c:321: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).
	nlen = strlen(user) + 1 + plen + 1;
data/libselinux-3.1/src/get_context_list.c:429: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(user_contexts_path) + strlen(user) + 2;
data/libselinux-3.1/src/get_context_list.c:429: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).
	fname_len = strlen(user_contexts_path) + strlen(user) + 2;
data/libselinux-3.1/src/get_default_type.c:35: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(role);
data/libselinux-3.1/src/get_default_type.c:41: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).
		if (buf[strlen(buf) - 1])
data/libselinux-3.1/src/get_default_type.c:42: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).
			buf[strlen(buf) - 1] = 0;
data/libselinux-3.1/src/get_default_type.c:65: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).
	t = malloc(strlen(buf) - len);
data/libselinux-3.1/src/get_initial_context.c:39:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, size - 1);
data/libselinux-3.1/src/getenforce.c:29:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, sizeof buf - 1);
data/libselinux-3.1/src/getfilecon.c:67:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		return strlen(*context) + 1;
data/libselinux-3.1/src/init.c:116:39:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (!strncmp(tmp + 1, SELINUXFS" ", strlen(SELINUXFS)+1)) {
data/libselinux-3.1/src/is_customizable_type.c:40: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).
				buf[strlen(buf) - 1] = 0;
data/libselinux-3.1/src/label_backends_android.c:41: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).
	size_t L1 = strlen(sp1->property_key);
data/libselinux-3.1/src/label_backends_android.c:42: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).
	size_t L2 = strlen(sp2->property_key);
data/libselinux-3.1/src/label_backends_android.c:262: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(spec_arr[i].property_key)) == 0) {
data/libselinux-3.1/src/label_file.c:168: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(reg_version);
data/libselinux-3.1/src/label_file.c:197:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			len = strlen(reg_arch);
data/libselinux-3.1/src/label_file.c:423: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).
	current_size = strlen(current);
data/libselinux-3.1/src/label_file.c:424: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).
	suffix_size = strlen(suffix);
data/libselinux-3.1/src/label_file.c:657: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).
		sub->slen = strlen(src);
data/libselinux-3.1/src/label_file.c:883:31:  [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).
		clean_key = (char *) malloc(strlen(key) + 1);
data/libselinux-3.1/src/label_file.c:1048:35:  [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).
		Sha1Update(&context, regex_str, strlen(regex_str) + 1);
data/libselinux-3.1/src/label_file.c:1050:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		Sha1Update(&context, ctx_raw, strlen(ctx_raw) + 1);
data/libselinux-3.1/src/label_file.h:106: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(mode);
data/libselinux-3.1/src/label_file.h:164: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(spec->regex_str);
data/libselinux-3.1/src/label_file.h:386: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(reg_buf);
data/libselinux-3.1/src/label_media.c:181:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (!strncmp(spec_arr[i].key, key, strlen(key) + 1))
data/libselinux-3.1/src/label_support.c:74: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(line_buf);
data/libselinux-3.1/src/lgetfilecon.c:68:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		return strlen(*context) + 1;
data/libselinux-3.1/src/lsetfilecon.c:12:56:  [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 rc = lsetxattr(path, XATTR_NAME_SELINUX, context, strlen(context) + 1,
data/libselinux-3.1/src/matchmediacon.c:27: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).
		if (current_line[strlen(current_line) - 1])
data/libselinux-3.1/src/matchmediacon.c:28: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).
			current_line[strlen(current_line) - 1] = 0;
data/libselinux-3.1/src/matchpathcon.c:212:23:  [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).
				fl->file = malloc(strlen(file) + 1);
data/libselinux-3.1/src/matchpathcon.c:229: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).
			fl->file = malloc(strlen(file) + 1);
data/libselinux-3.1/src/matchpathcon.c:245: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).
	fl->file = malloc(strlen(file) + 1);
data/libselinux-3.1/src/matchpathcon.c:400:7:  [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.
		p = strcpy(resolved_path, "");
data/libselinux-3.1/src/matchpathcon.c:417: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(p);
data/libselinux-3.1/src/matchpathcon.c:418: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).
	if (len + strlen(last_component) + 2 > PATH_MAX) {
data/libselinux-3.1/src/matchpathcon.c:427:2:  [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(resolved_path, "/");
data/libselinux-3.1/src/policyvers.c:33:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, sizeof buf - 1);
data/libselinux-3.1/src/procattr.c:170:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(fd, buf, size - 1);
data/libselinux-3.1/src/procattr.c:258:30:  [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).
			ret = write(fd, context2, strlen(context2) + 1);
data/libselinux-3.1/src/query_user_context.c:88: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).
		if (newfield[strlen(newfield) - 1] == '\n')
data/libselinux-3.1/src/query_user_context.c:89: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).
			newfield[strlen(newfield) - 1] = '\0';
data/libselinux-3.1/src/query_user_context.c:91: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(newfield) == 0) {
data/libselinux-3.1/src/regex.c:457: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).
		       subject, strlen(subject), 0,
data/libselinux-3.1/src/regex.c:572: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).
	if ((size_t)rc < strlen(error_data->error_buffer))
data/libselinux-3.1/src/reject_unknown.c:29:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, sizeof(buf) - 1);
data/libselinux-3.1/src/selinux_config.c:182: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).
				end = type + strlen(type) - 1;
data/libselinux-3.1/src/selinux_restorecon.c:174: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(directory);
data/libselinux-3.1/src/selinux_restorecon.c:1232: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(rootpath);
data/libselinux-3.1/src/setenforce.c:29:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/libselinux-3.1/src/setfilecon.c:12: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).
	int rc = setxattr(path, XATTR_NAME_SELINUX, context, strlen(context) + 1,
data/libselinux-3.1/src/setrans_client.c:69:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(addr.sun_path, SETRANS_UNIX_SOCKET, sizeof(addr.sun_path));
data/libselinux-3.1/src/setrans_client.c:97: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).
	data1_size = strlen(data1) + 1;
data/libselinux-3.1/src/setrans_client.c:98: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).
	data2_size = strlen(data2) + 1;
data/libselinux-3.1/src/seusers.c:293: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(service);
data/libselinux-3.1/src/seusers.c:314: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(level);
data/libselinux-3.1/src/stringrep.c:88:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, sizeof(buf) - 1);
data/libselinux-3.1/src/stringrep.c:124:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(fd, buf, sizeof(buf) - 1);
data/libselinux-3.1/src/stringrep.c:284: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).
				len += strlen(str) + 1;
data/libselinux-3.1/src/stringrep.c:311:2:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
	sprintf(ptr, "}");
data/libselinux-3.1/src/validatetrans.c:49:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/libselinux-3.1/utils/avcstat.c:113:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(avcstatfile, optarg, sizeof(avcstatfile) - 1);
data/libselinux-3.1/utils/avcstat.c:159:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(fd, buf, DEF_BUF_SIZE-1);
data/libselinux-3.1/utils/matchpathcon.c:153: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(path);
data/libselinux-3.1/utils/sefcontext_compile.c:129: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).
	section_len = strlen(reg_version);
data/libselinux-3.1/utils/sefcontext_compile.c:141: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).
	section_len = strlen(reg_arch);
data/libselinux-3.1/utils/sefcontext_compile.c:187: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).
		to_write = strlen(context) + 1;
data/libselinux-3.1/utils/sefcontext_compile.c:198: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).
		to_write = strlen(regex_str) + 1;
data/libselinux-3.1/utils/sefcontext_compile.c:411: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).
	tmp = malloc(strlen(stack_path) + 7);
data/libselinux-3.1/utils/selabel_digest.c:173:27:  [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).
		cmd_ptr = &cmd_buf[0] + strlen(cmd_buf);
data/libselinux-3.1/utils/selabel_digest.c:177: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).
			cmd_ptr += strlen(specfiles[i]) + 1;
data/libselinux-3.1/utils/selabel_lookup_best_match.c:104: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).
			string_len = strlen(argv[i]) + 1;
data/libselinux-3.1/utils/setenforce.c:27:6:  [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(argv[1]) == 1 && (argv[1][0] == '0' || argv[1][0] == '1')) {

ANALYSIS SUMMARY:

Hits = 335
Lines analyzed = 20323 in approximately 0.55 seconds (37135 lines/second)
Physical Source Lines of Code (SLOC) = 14992
Hits@level = [0] 290 [1] 119 [2] 165 [3]  18 [4]  33 [5]   0
Hits@level+ = [0+] 625 [1+] 335 [2+] 216 [3+]  51 [4+]  33 [5+]   0
Hits/KSLOC@level+ = [0+] 41.6889 [1+] 22.3453 [2+] 14.4077 [3+] 3.40181 [4+] 2.20117 [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.