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/libsemanage-3.1/example/test_fcontext.c
Examining data/libsemanage-3.1/include/semanage/boolean_record.h
Examining data/libsemanage-3.1/include/semanage/booleans_active.h
Examining data/libsemanage-3.1/include/semanage/booleans_local.h
Examining data/libsemanage-3.1/include/semanage/booleans_policy.h
Examining data/libsemanage-3.1/include/semanage/context_record.h
Examining data/libsemanage-3.1/include/semanage/debug.h
Examining data/libsemanage-3.1/include/semanage/fcontext_record.h
Examining data/libsemanage-3.1/include/semanage/fcontexts_local.h
Examining data/libsemanage-3.1/include/semanage/fcontexts_policy.h
Examining data/libsemanage-3.1/include/semanage/handle.h
Examining data/libsemanage-3.1/include/semanage/ibendport_record.h
Examining data/libsemanage-3.1/include/semanage/ibendports_local.h
Examining data/libsemanage-3.1/include/semanage/ibendports_policy.h
Examining data/libsemanage-3.1/include/semanage/ibpkey_record.h
Examining data/libsemanage-3.1/include/semanage/ibpkeys_local.h
Examining data/libsemanage-3.1/include/semanage/ibpkeys_policy.h
Examining data/libsemanage-3.1/include/semanage/iface_record.h
Examining data/libsemanage-3.1/include/semanage/interfaces_local.h
Examining data/libsemanage-3.1/include/semanage/interfaces_policy.h
Examining data/libsemanage-3.1/include/semanage/modules.h
Examining data/libsemanage-3.1/include/semanage/node_record.h
Examining data/libsemanage-3.1/include/semanage/nodes_local.h
Examining data/libsemanage-3.1/include/semanage/nodes_policy.h
Examining data/libsemanage-3.1/include/semanage/port_record.h
Examining data/libsemanage-3.1/include/semanage/ports_local.h
Examining data/libsemanage-3.1/include/semanage/ports_policy.h
Examining data/libsemanage-3.1/include/semanage/semanage.h
Examining data/libsemanage-3.1/include/semanage/seuser_record.h
Examining data/libsemanage-3.1/include/semanage/seusers_local.h
Examining data/libsemanage-3.1/include/semanage/seusers_policy.h
Examining data/libsemanage-3.1/include/semanage/user_record.h
Examining data/libsemanage-3.1/include/semanage/users_local.h
Examining data/libsemanage-3.1/include/semanage/users_policy.h
Examining data/libsemanage-3.1/src/boolean_internal.h
Examining data/libsemanage-3.1/src/boolean_record.c
Examining data/libsemanage-3.1/src/booleans_active.c
Examining data/libsemanage-3.1/src/booleans_activedb.c
Examining data/libsemanage-3.1/src/booleans_file.c
Examining data/libsemanage-3.1/src/booleans_local.c
Examining data/libsemanage-3.1/src/booleans_policy.c
Examining data/libsemanage-3.1/src/booleans_policydb.c
Examining data/libsemanage-3.1/src/context_record.c
Examining data/libsemanage-3.1/src/database.c
Examining data/libsemanage-3.1/src/database.h
Examining data/libsemanage-3.1/src/database_activedb.c
Examining data/libsemanage-3.1/src/database_activedb.h
Examining data/libsemanage-3.1/src/database_file.c
Examining data/libsemanage-3.1/src/database_file.h
Examining data/libsemanage-3.1/src/database_join.c
Examining data/libsemanage-3.1/src/database_join.h
Examining data/libsemanage-3.1/src/database_llist.c
Examining data/libsemanage-3.1/src/database_llist.h
Examining data/libsemanage-3.1/src/database_policydb.c
Examining data/libsemanage-3.1/src/database_policydb.h
Examining data/libsemanage-3.1/src/debug.c
Examining data/libsemanage-3.1/src/debug.h
Examining data/libsemanage-3.1/src/direct_api.c
Examining data/libsemanage-3.1/src/direct_api.h
Examining data/libsemanage-3.1/src/fcontext_internal.h
Examining data/libsemanage-3.1/src/fcontext_record.c
Examining data/libsemanage-3.1/src/fcontexts_file.c
Examining data/libsemanage-3.1/src/fcontexts_local.c
Examining data/libsemanage-3.1/src/fcontexts_policy.c
Examining data/libsemanage-3.1/src/genhomedircon.c
Examining data/libsemanage-3.1/src/genhomedircon.h
Examining data/libsemanage-3.1/src/handle.c
Examining data/libsemanage-3.1/src/handle.h
Examining data/libsemanage-3.1/src/ibendport_internal.h
Examining data/libsemanage-3.1/src/ibendport_record.c
Examining data/libsemanage-3.1/src/ibendports_file.c
Examining data/libsemanage-3.1/src/ibendports_local.c
Examining data/libsemanage-3.1/src/ibendports_policy.c
Examining data/libsemanage-3.1/src/ibendports_policydb.c
Examining data/libsemanage-3.1/src/ibpkey_internal.h
Examining data/libsemanage-3.1/src/ibpkey_record.c
Examining data/libsemanage-3.1/src/ibpkeys_file.c
Examining data/libsemanage-3.1/src/ibpkeys_local.c
Examining data/libsemanage-3.1/src/ibpkeys_policy.c
Examining data/libsemanage-3.1/src/ibpkeys_policydb.c
Examining data/libsemanage-3.1/src/iface_internal.h
Examining data/libsemanage-3.1/src/iface_record.c
Examining data/libsemanage-3.1/src/interfaces_file.c
Examining data/libsemanage-3.1/src/interfaces_local.c
Examining data/libsemanage-3.1/src/interfaces_policy.c
Examining data/libsemanage-3.1/src/interfaces_policydb.c
Examining data/libsemanage-3.1/src/modules.c
Examining data/libsemanage-3.1/src/modules.h
Examining data/libsemanage-3.1/src/node_internal.h
Examining data/libsemanage-3.1/src/node_record.c
Examining data/libsemanage-3.1/src/nodes_file.c
Examining data/libsemanage-3.1/src/nodes_local.c
Examining data/libsemanage-3.1/src/nodes_policy.c
Examining data/libsemanage-3.1/src/nodes_policydb.c
Examining data/libsemanage-3.1/src/parse_utils.c
Examining data/libsemanage-3.1/src/parse_utils.h
Examining data/libsemanage-3.1/src/policy.h
Examining data/libsemanage-3.1/src/policy_components.c
Examining data/libsemanage-3.1/src/port_internal.h
Examining data/libsemanage-3.1/src/port_record.c
Examining data/libsemanage-3.1/src/ports_file.c
Examining data/libsemanage-3.1/src/ports_local.c
Examining data/libsemanage-3.1/src/ports_policy.c
Examining data/libsemanage-3.1/src/ports_policydb.c
Examining data/libsemanage-3.1/src/semanage_conf.h
Examining data/libsemanage-3.1/src/semanage_store.c
Examining data/libsemanage-3.1/src/semanage_store.h
Examining data/libsemanage-3.1/src/seuser_internal.h
Examining data/libsemanage-3.1/src/seuser_record.c
Examining data/libsemanage-3.1/src/seusers_file.c
Examining data/libsemanage-3.1/src/seusers_local.c
Examining data/libsemanage-3.1/src/seusers_policy.c
Examining data/libsemanage-3.1/src/user_base_record.c
Examining data/libsemanage-3.1/src/user_extra_record.c
Examining data/libsemanage-3.1/src/user_internal.h
Examining data/libsemanage-3.1/src/user_record.c
Examining data/libsemanage-3.1/src/users_base_file.c
Examining data/libsemanage-3.1/src/users_base_policydb.c
Examining data/libsemanage-3.1/src/users_extra_file.c
Examining data/libsemanage-3.1/src/users_join.c
Examining data/libsemanage-3.1/src/users_local.c
Examining data/libsemanage-3.1/src/users_policy.c
Examining data/libsemanage-3.1/src/utilities.c
Examining data/libsemanage-3.1/src/utilities.h
Examining data/libsemanage-3.1/tests/libsemanage-tests.c
Examining data/libsemanage-3.1/tests/test_bool.c
Examining data/libsemanage-3.1/tests/test_bool.h
Examining data/libsemanage-3.1/tests/test_fcontext.c
Examining data/libsemanage-3.1/tests/test_fcontext.h
Examining data/libsemanage-3.1/tests/test_handle.c
Examining data/libsemanage-3.1/tests/test_handle.h
Examining data/libsemanage-3.1/tests/test_ibendport.c
Examining data/libsemanage-3.1/tests/test_ibendport.h
Examining data/libsemanage-3.1/tests/test_iface.c
Examining data/libsemanage-3.1/tests/test_iface.h
Examining data/libsemanage-3.1/tests/test_node.c
Examining data/libsemanage-3.1/tests/test_node.h
Examining data/libsemanage-3.1/tests/test_other.c
Examining data/libsemanage-3.1/tests/test_other.h
Examining data/libsemanage-3.1/tests/test_port.c
Examining data/libsemanage-3.1/tests/test_port.h
Examining data/libsemanage-3.1/tests/test_semanage_store.c
Examining data/libsemanage-3.1/tests/test_semanage_store.h
Examining data/libsemanage-3.1/tests/test_user.c
Examining data/libsemanage-3.1/tests/test_user.h
Examining data/libsemanage-3.1/tests/test_utilities.c
Examining data/libsemanage-3.1/tests/test_utilities.h
Examining data/libsemanage-3.1/tests/utilities.c
Examining data/libsemanage-3.1/tests/utilities.h

FINAL RESULTS:

data/libsemanage-3.1/tests/test_semanage_store.c:163:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(modpath, 0);
data/libsemanage-3.1/tests/test_semanage_store.c:165:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(readlockpath, 0);
data/libsemanage-3.1/tests/test_semanage_store.c:167:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(polpath, 0);
data/libsemanage-3.1/tests/test_semanage_store.c:174:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(polpath, S_IRUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:176:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(readlockpath, S_IRUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:178:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(modpath, S_IRUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:185:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(polpath, S_IRUSR | S_IWUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:187:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(readlockpath, S_IRUSR | S_IWUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:189:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(modpath, S_IRUSR | S_IWUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:196:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(polpath, S_IRUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:198:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(readlockpath, 0);
data/libsemanage-3.1/tests/test_semanage_store.c:200:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(modpath, S_IRUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:207:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(polpath, S_IRUSR | S_IWUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:209:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(readlockpath, 0);
data/libsemanage-3.1/tests/test_semanage_store.c:211:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(modpath, S_IRUSR | S_IWUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:222:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(modpath, 0);
data/libsemanage-3.1/tests/test_semanage_store.c:224:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(polpath, 0);
data/libsemanage-3.1/tests/test_semanage_store.c:231:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(polpath, S_IRUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:233:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(modpath, S_IRUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:240:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(polpath, S_IRUSR | S_IWUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:247:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(polpath, S_IRUSR | S_IWUSR | S_IXUSR);
data/libsemanage-3.1/tests/test_semanage_store.c:249:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	err = chmod(modpath, S_IRUSR | S_IWUSR | S_IXUSR);
data/libsemanage-3.1/include/semanage/debug.h:45: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.
				      __attribute__ ((format(printf, 3, 4)))
data/libsemanage-3.1/src/debug.c:49: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, 3, 4)))
data/libsemanage-3.1/src/debug.c:79: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(stream, fmt, ap);
data/libsemanage-3.1/src/debug.c:89: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, 3, 4)))
data/libsemanage-3.1/src/debug.c:103:2:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	vsnprintf(buffer, sizeof(buffer), fmt, ap);
data/libsemanage-3.1/src/debug.c:115: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.
				      __attribute__ ((format(printf, 3, 4)))
data/libsemanage-3.1/src/debug.h:62: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, 3, 4)))
data/libsemanage-3.1/src/debug.h:69: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, 3, 4)))
data/libsemanage-3.1/src/direct_api.c:881:12:  [4] (shell) execl:
  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.
		retval = execl(path, path, NULL);
data/libsemanage-3.1/src/genhomedircon.c:441:6:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	if (fprintf(out, COMMENT_FILE_CONTEXT_HEADER) < 0) {
data/libsemanage-3.1/src/genhomedircon.c:693:7:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		if (fprintf(out, COMMENT_USER_HOME_CONTEXT, FALLBACK_SENAME) < 0)
data/libsemanage-3.1/src/genhomedircon.c:696:7:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		if (fprintf(out, COMMENT_USER_HOME_CONTEXT, user->name) < 0)
data/libsemanage-3.1/src/handle.h:43:25:  [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, 3, 4)))
data/libsemanage-3.1/src/semanage_store.c:180:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(semanage_files[i], "%s%s", root,
data/libsemanage-3.1/src/semanage_store.c:208:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(semanage_paths[i][j], "%s%s%s", root,
data/libsemanage-3.1/src/semanage_store.c:240:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(semanage_final[SEMANAGE_FINAL_TMP],
data/libsemanage-3.1/src/semanage_store.c:259:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(semanage_final[SEMANAGE_FINAL_SELINUX],
data/libsemanage-3.1/src/semanage_store.c:402:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(semanage_final_paths[i][j],
data/libsemanage-3.1/src/semanage_store.c:660:6:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (access(path, R_OK | X_OK) != 0)
data/libsemanage-3.1/src/semanage_store.c:671:6:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (access(path, R_OK) != 0) {
data/libsemanage-3.1/src/semanage_store.c:672: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(path, F_OK) == 0) {
data/libsemanage-3.1/src/semanage_store.c:677: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(path, R_OK | W_OK | X_OK) != 0) {
data/libsemanage-3.1/src/semanage_store.c:687:6:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (access(path, R_OK | W_OK | X_OK) != 0)
data/libsemanage-3.1/src/semanage_store.c:885:11:  [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).
	for (c = strcpy(fn, path) + 1; *c != '\0'; c++) {
data/libsemanage-3.1/src/semanage_store.c:1024: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(fn, semanage_final_path(SEMANAGE_FINAL_TMP, i));
data/libsemanage-3.1/src/semanage_store.c:1645: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(fn, dst);
data/libsemanage-3.1/src/seusers_local.c:43:7:  [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(roles,roles_arr[0]);
data/libsemanage-3.1/src/seusers_local.c:46:8:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
							strcat(roles,roles_arr[i]);
data/libsemanage-3.1/src/seusers_local.c:88:4:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
			strcat(msg,sep);
data/libsemanage-3.1/src/seusers_local.c:93:4:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
			strcat(msg,sep);
data/libsemanage-3.1/src/seusers_local.c:98:4:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
			strcat(msg,sep);
data/libsemanage-3.1/src/utilities.c:284: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(pres, psrc);
data/libsemanage-3.1/tests/libsemanage-tests.c:109:14:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((i = getopt_long(argc, argv, "vi", opts, NULL)) != -1) {
data/libsemanage-3.1/src/database_file.c:34: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 *path[2];
data/libsemanage-3.1/src/database_file.c:130: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).
	str = fopen(fname, "w");
data/libsemanage-3.1/src/database_policydb.c:29:15:  [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 *path[2];
data/libsemanage-3.1/src/database_policydb.c:114: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, "rb");
data/libsemanage-3.1/src/debug.c:97: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 buffer[1024];
data/libsemanage-3.1/src/direct_api.c:466:11:  [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 ((f = fopen(filename, "wb")) == NULL) {
data/libsemanage-3.1/src/direct_api.c:562: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(&uncompress[total], buf, nBuf);
data/libsemanage-3.1/src/direct_api.c:596: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);
data/libsemanage-3.1/src/direct_api.c:616: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(*data, uncompress, size);
data/libsemanage-3.1/src/direct_api.c:645: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).
	     open(filename, O_WRONLY | O_CREAT | O_TRUNC,
data/libsemanage-3.1/src/direct_api.c:998: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 fn[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:1010: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(fn, "w");
data/libsemanage-3.1/src/direct_api.c:1042: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 cil_path[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:1043: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 hll_path[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:1149: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 cil_path[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:1263:11:  [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).
		touch = fopen(path, "w");
data/libsemanage-3.1/src/direct_api.c:1295:11:  [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).
		touch = fopen(path, "w");
data/libsemanage-3.1/src/direct_api.c:1841: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 module_path[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:1842: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 input_file[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:2016: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/libsemanage-3.1/src/direct_api.c:2072: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 fn[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:2138: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).
			fp = fopen(fn, "w");
data/libsemanage-3.1/src/direct_api.c:2229: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 fn[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:2325: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(fn, "r");
data/libsemanage-3.1/src/direct_api.c:2415: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 fn[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:2590: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 priority_path[PATH_MAX];
data/libsemanage-3.1/src/direct_api.c:2791: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/libsemanage-3.1/src/direct_api.c:2918: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/libsemanage-3.1/src/genhomedircon.c:221:11:  [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).
	shells = fopen(PATH_SHELLS_FILE, "r");
data/libsemanage-3.1/src/genhomedircon.c:338:10:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		temp = atoi(path);
data/libsemanage-3.1/src/genhomedircon.c:347:10:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		temp = atoi(path);
data/libsemanage-3.1/src/genhomedircon.c:355:10:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		temp = atoi(path);
data/libsemanage-3.1/src/genhomedircon.c:506:18:  [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).
	template_file = fopen(s->homedir_template_path, "r");
data/libsemanage-3.1/src/genhomedircon.c:977: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 uid[11];
data/libsemanage-3.1/src/genhomedircon.c:978: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 gid[11];
data/libsemanage-3.1/src/genhomedircon.c:1406: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 (!(out = fopen(s.fcfilepath, "w"))) {
data/libsemanage-3.1/src/parse_utils.c:48:22:  [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).
	info->file_stream = fopen(info->filename, "r");
data/libsemanage-3.1/src/semanage_store.c:76: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 *semanage_paths[SEMANAGE_NUM_STORES][SEMANAGE_STORE_NUM_PATHS];
data/libsemanage-3.1/src/semanage_store.c:77: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 *semanage_files[SEMANAGE_NUM_FILES] = { NULL };
data/libsemanage-3.1/src/semanage_store.c:81:14:  [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 const char *semanage_relative_files[SEMANAGE_NUM_FILES] = {
data/libsemanage-3.1/src/semanage_store.c:87:14:  [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 const char *semanage_store_paths[SEMANAGE_NUM_STORES] = {
data/libsemanage-3.1/src/semanage_store.c:95:14:  [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 const char *semanage_sandbox_paths[SEMANAGE_STORE_NUM_PATHS] = {
data/libsemanage-3.1/src/semanage_store.c:124: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 const * const semanage_final_prefix[SEMANAGE_FINAL_NUM] = {
data/libsemanage-3.1/src/semanage_store.c:129: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 *semanage_final[SEMANAGE_FINAL_NUM] = { NULL };
data/libsemanage-3.1/src/semanage_store.c:130: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 *semanage_final_suffix[SEMANAGE_FINAL_PATH_NUM] = { NULL };
data/libsemanage-3.1/src/semanage_store.c:131: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 *semanage_final_paths[SEMANAGE_FINAL_NUM][SEMANAGE_FINAL_PATH_NUM] = {{ NULL }};
data/libsemanage-3.1/src/semanage_store.c:282: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/libsemanage-3.1/src/semanage_store.c:434:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char root[PATH_MAX];
data/libsemanage-3.1/src/semanage_store.c:714: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 tmp[PATH_MAX];
data/libsemanage-3.1/src/semanage_store.c:715: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[4192];
data/libsemanage-3.1/src/semanage_store.c:722:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((in = open(src, O_RDONLY)) == -1) {
data/libsemanage-3.1/src/semanage_store.c:730:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((out = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, mode)) == -1) {
data/libsemanage-3.1/src/semanage_store.c:786: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], path2[PATH_MAX];
data/libsemanage-3.1/src/semanage_store.c:850:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char s[PATH_MAX];
data/libsemanage-3.1/src/semanage_store.c:877: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 fn[PATH_MAX];
data/libsemanage-3.1/src/semanage_store.c:985: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 fn[PATH_MAX];
data/libsemanage-3.1/src/semanage_store.c:1050: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/libsemanage-3.1/src/semanage_store.c:1253: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(s + s_len, t, t_len);
data/libsemanage-3.1/src/semanage_store.c:1449:12:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
	forkval = vfork();
data/libsemanage-3.1/src/semanage_store.c:1494: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[PATH_MAX] = { 0 };
data/libsemanage-3.1/src/semanage_store.c:1497:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	file_con = fopen(semanage_path(SEMANAGE_TMP, SEMANAGE_FC_TMPL), "r");
data/libsemanage-3.1/src/semanage_store.c:1504: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).
	fc = open(semanage_path(SEMANAGE_TMP, SEMANAGE_STORE_FC),
data/libsemanage-3.1/src/semanage_store.c:1511: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).
	hd = open(semanage_path(SEMANAGE_TMP, SEMANAGE_HOMEDIR_TMPL),
data/libsemanage-3.1/src/semanage_store.c:1624: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 fn[PATH_MAX];
data/libsemanage-3.1/src/semanage_store.c:1706: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 write_buf[32];
data/libsemanage-3.1/src/semanage_store.c:1724: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).
	     open(commit_filename, O_WRONLY | O_CREAT | O_TRUNC,
data/libsemanage-3.1/src/semanage_store.c:1860:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(lock_file, O_RDONLY)) == -1) {
data/libsemanage-3.1/src/semanage_store.c:1862: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).
		     open(lock_file, O_RDWR | O_CREAT | O_TRUNC,
data/libsemanage-3.1/src/semanage_store.c:1993: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[32];
data/libsemanage-3.1/src/semanage_store.c:2007:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(commit_filename, O_RDONLY)) == -1) {
data/libsemanage-3.1/src/semanage_store.c:2054:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fp = fopen(filename, "rb")) == NULL) {
data/libsemanage-3.1/src/semanage_store.c:2120: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(kernel_filename, "r")) == NULL) {
data/libsemanage-3.1/src/semanage_store.c:2163: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).
	if ((outfile = fopen(kernel_filename, "wb")) == NULL) {
data/libsemanage-3.1/src/seusers_local.c:70: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 msg[1024];
data/libsemanage-3.1/src/seusers_local.c:73:2:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
	strcpy(msg, "login");
data/libsemanage-3.1/src/seusers_local.c:89:4:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
			strcat(msg,"sename");
data/libsemanage-3.1/src/seusers_local.c:94:4:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
			strcat(msg,"role");
data/libsemanage-3.1/src/seusers_local.c:99:4:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
			strcat(msg,"range");
data/libsemanage-3.1/src/utilities.c:43: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 ((fd = fopen(file, "r")) == NULL)
data/libsemanage-3.1/src/utilities.c:269: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(pres, psrc, length);
data/libsemanage-3.1/src/utilities.c:274: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(pres, replace, rlen);
data/libsemanage-3.1/tests/test_fcontext.c:100: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).
	FILE *fptr = fopen("test-policy/store/active/file_contexts", "w+");
data/libsemanage-3.1/tests/test_semanage_store.c:315:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	sourcefd = open("nc_sort_unsorted", O_RDONLY);
data/libsemanage-3.1/tests/test_semanage_store.c:327:11:  [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).
	goodfd = open("nc_sort_sorted", O_RDONLY);
data/libsemanage-3.1/tests/test_semanage_store.c:338:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	badfd = open("nc_sort_malformed", O_RDONLY);
data/libsemanage-3.1/tests/test_utilities.c:58:7:  [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(fname);
data/libsemanage-3.1/tests/utilities.c:60: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).
	fptr = fopen("test-policy/etc/selinux/semanage.conf", "w+");
data/libsemanage-3.1/tests/utilities.c:80: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).
	FILE *fptr = fopen("test-policy/store/active/policy.kern", "wb+");
data/libsemanage-3.1/tests/utilities.c:101: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).
	FILE *fptr = fopen(filename, "rb");
data/libsemanage-3.1/tests/utilities.c:133: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).
	FILE *fptr = fopen("test-policy/store/active/modules/100/base/cil",
data/libsemanage-3.1/tests/utilities.c:149: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).
	fptr = fopen("test-policy/store/active/modules/100/base/lang_ext",
data/libsemanage-3.1/src/database_file.c:129:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	mask = umask(0077);
data/libsemanage-3.1/src/database_file.c:131:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(mask);
data/libsemanage-3.1/src/direct_api.c:784:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((read_len = read(fd, data_read + data_read_len, max_len - data_read_len)) > 0) {
data/libsemanage-3.1/src/direct_api.c:1211:16:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	mode_t mask = umask(0077);
data/libsemanage-3.1/src/direct_api.c:1690:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(mask);
data/libsemanage-3.1/src/direct_api.c:2137:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mask = umask(0077);
data/libsemanage-3.1/src/direct_api.c:2139:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/libsemanage-3.1/src/direct_api.c:2792:16:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	mode_t mask = umask(0077);
data/libsemanage-3.1/src/direct_api.c:2904:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(mask);
data/libsemanage-3.1/src/genhomedircon.c:254: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(oexpr);
data/libsemanage-3.1/src/genhomedircon.c:375: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(pwbuf->pw_dir) -1;
data/libsemanage-3.1/src/genhomedircon.c:538: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).
	off = strlen(p);
data/libsemanage-3.1/src/genhomedircon.c:1020: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).
	int len = strlen(pwent->pw_dir) -1;
data/libsemanage-3.1/src/handle.c:160: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(sh->conf->compiler_directory_path) + strlen("/") + strlen(lower_lang_ext) + 1;
data/libsemanage-3.1/src/handle.c:160:52:  [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(sh->conf->compiler_directory_path) + strlen("/") + strlen(lower_lang_ext) + 1;
data/libsemanage-3.1/src/handle.c:160:66:  [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(sh->conf->compiler_directory_path) + strlen("/") + strlen(lower_lang_ext) + 1;
data/libsemanage-3.1/src/parse_utils.c:194: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).
	size_t len = strlen(assert_str);
data/libsemanage-3.1/src/parse_utils.c:225: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).
	size_t len = strlen(str);
data/libsemanage-3.1/src/parse_utils.c:299:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(tmp_str, start, len);
data/libsemanage-3.1/src/semanage_store.c:173: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).
	prefix_len = strlen(root);
data/libsemanage-3.1/src/semanage_store.c:176: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(semanage_relative_files[i]) + prefix_len);
data/libsemanage-3.1/src/semanage_store.c:199: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).
	prefix_len = strlen(root);
data/libsemanage-3.1/src/semanage_store.c:203: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 = prefix_len + strlen(semanage_store_paths[i])
data/libsemanage-3.1/src/semanage_store.c:204: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).
			    + strlen(semanage_sandbox_paths[j]);
data/libsemanage-3.1/src/semanage_store.c:226:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t store_len = strlen(store_path);
data/libsemanage-3.1/src/semanage_store.c:229: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(semanage_root()) +
data/libsemanage-3.1/src/semanage_store.c:230: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(prefix) +
data/libsemanage-3.1/src/semanage_store.c:231: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("/") +
data/libsemanage-3.1/src/semanage_store.c:232: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(semanage_final_prefix[SEMANAGE_FINAL_TMP]) +
data/libsemanage-3.1/src/semanage_store.c:249: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(semanage_root()) +
data/libsemanage-3.1/src/semanage_store.c:250: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(selinux_root) +
data/libsemanage-3.1/src/semanage_store.c:251: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(semanage_final_prefix[SEMANAGE_FINAL_SELINUX]) +
data/libsemanage-3.1/src/semanage_store.c:283: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).
	size_t offset = strlen(selinux_policy_root());
data/libsemanage-3.1/src/semanage_store.c:392: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).
			len = 	  strlen(semanage_final[i])
data/libsemanage-3.1/src/semanage_store.c:393:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				+ strlen(semanage_final_suffix[j]);
data/libsemanage-3.1/src/semanage_store.c:519: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(semanage_root()) + strlen(selinux_path()) + strlen(SEMANAGE_CONF_FILE);
data/libsemanage-3.1/src/semanage_store.c:519: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).
	len = strlen(semanage_root()) + strlen(selinux_path()) + strlen(SEMANAGE_CONF_FILE);
data/libsemanage-3.1/src/semanage_store.c:519:59:  [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(semanage_root()) + strlen(selinux_path()) + strlen(SEMANAGE_CONF_FILE);
data/libsemanage-3.1/src/semanage_store.c:548:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:550:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
				umask(mask);
data/libsemanage-3.1/src/semanage_store.c:555:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/libsemanage-3.1/src/semanage_store.c:574:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:576:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
				umask(mask);
data/libsemanage-3.1/src/semanage_store.c:582:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/libsemanage-3.1/src/semanage_store.c:600:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:602:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
				umask(mask);
data/libsemanage-3.1/src/semanage_store.c:608:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/libsemanage-3.1/src/semanage_store.c:626:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:628:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
				umask(mask);
data/libsemanage-3.1/src/semanage_store.c:633:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/libsemanage-3.1/src/semanage_store.c:729:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	mask = umask(0);
data/libsemanage-3.1/src/semanage_store.c:731:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
		umask(mask);
data/libsemanage-3.1/src/semanage_store.c:737:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(mask);
data/libsemanage-3.1/src/semanage_store.c:738:39:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while (retval == 0 && (amount_read = read(in, buf, sizeof(buf))) > 0) {
data/libsemanage-3.1/src/semanage_store.c:795:10:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
		mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:797:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/libsemanage-3.1/src/semanage_store.c:801:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
		umask(mask);
data/libsemanage-3.1/src/semanage_store.c:813:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:816:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
				umask(mask);
data/libsemanage-3.1/src/semanage_store.c:819:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/libsemanage-3.1/src/semanage_store.c:821:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:824:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
				umask(mask);
data/libsemanage-3.1/src/semanage_store.c:827:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/libsemanage-3.1/src/semanage_store.c:881: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(path) >= PATH_MAX) {
data/libsemanage-3.1/src/semanage_store.c:912:10:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
		mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:914:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/libsemanage-3.1/src/semanage_store.c:920:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
		umask(mask);
data/libsemanage-3.1/src/semanage_store.c:962:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:966:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
		umask(mask);
data/libsemanage-3.1/src/semanage_store.c:970:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(mask);
data/libsemanage-3.1/src/semanage_store.c:1019: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(semanage_final_path(SEMANAGE_FINAL_TMP, i)) >= sizeof(fn)) {
data/libsemanage-3.1/src/semanage_store.c:1222:32:  [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 len = (s == NULL ? 0 : strlen(s));
data/libsemanage-3.1/src/semanage_store.c:1240: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).
	size_t s_len = (s == NULL ? 0 : strlen(s));
data/libsemanage-3.1/src/semanage_store.c:1247: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).
	t_len = strlen(t);
data/libsemanage-3.1/src/semanage_store.c:1524: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).
			if (write(hd, buf, strlen(buf)) < 0) {
data/libsemanage-3.1/src/semanage_store.c:1531: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).
			if (write(fc, buf, strlen(buf)) < 0) {
data/libsemanage-3.1/src/semanage_store.c:1640: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(dst) >= sizeof(fn)) {
data/libsemanage-3.1/src/semanage_store.c:2020:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	amount_read = read(fd, buf, sizeof(buf));
data/libsemanage-3.1/src/semanage_store.c:2157:16:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	mode_t mask = umask(0077);
data/libsemanage-3.1/src/semanage_store.c:2186:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(mask);
data/libsemanage-3.1/src/semanage_store.c:2822: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).
			i = strlen(current->file_type) + 1;	/* +1 for tab */
data/libsemanage-3.1/src/semanage_store.c:2829: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).
		i = strlen(current->context) + 1;	/* +1 for newline */
data/libsemanage-3.1/src/seusers_local.c:36: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).
					size += (strlen(roles_arr[i]) + 1);
data/libsemanage-3.1/src/seusers_local.c:45:8:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
							strcat(roles,",");
data/libsemanage-3.1/src/utilities.c:69: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).
	return strncmp(str, prefix, strlen(prefix)) == 0;
data/libsemanage-3.1/src/utilities.c:101:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	return strdup(retval + strlen(delim));
data/libsemanage-3.1/src/utilities.c:223: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(str);
data/libsemanage-3.1/src/utilities.c:240: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).
	slen = strlen(search);
data/libsemanage-3.1/src/utilities.c:241: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).
	rlen = strlen(replace);
data/libsemanage-3.1/src/utilities.c:257: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).
	newsize = strlen(src) + 1 + count * (rlen - slen);
data/libsemanage-3.1/src/utilities.c:283: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).
	assert(pres + strlen(psrc) + 1 == result + newsize);

ANALYSIS SUMMARY:

Hits = 237
Lines analyzed = 30030 in approximately 0.62 seconds (48252 lines/second)
Physical Source Lines of Code (SLOC) = 20855
Hits@level = [0] 103 [1]  91 [2]  91 [3]   1 [4]  32 [5]  22
Hits@level+ = [0+] 340 [1+] 237 [2+] 146 [3+]  55 [4+]  54 [5+]  22
Hits/KSLOC@level+ = [0+] 16.303 [1+] 11.3642 [2+] 7.00072 [3+] 2.63726 [4+] 2.58931 [5+] 1.0549
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.