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/afuse-0.4.1/compat/fuse_opt.c
Examining data/afuse-0.4.1/compat/fuse_opt.h
Examining data/afuse-0.4.1/src/afuse.c
Examining data/afuse-0.4.1/src/afuse.h
Examining data/afuse-0.4.1/src/dir_list.c
Examining data/afuse-0.4.1/src/dir_list.h
Examining data/afuse-0.4.1/src/fd_list.c
Examining data/afuse-0.4.1/src/fd_list.h
Examining data/afuse-0.4.1/src/string_sorted_list.c
Examining data/afuse-0.4.1/src/string_sorted_list.h
Examining data/afuse-0.4.1/src/utils.c
Examining data/afuse-0.4.1/src/utils.h
Examining data/afuse-0.4.1/src/variable_pairing_heap.h

FINAL RESULTS:

data/afuse-0.4.1/src/afuse.c:717:9:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
		res = readlink(real_path, buf, size - 1);
data/afuse-0.4.1/src/afuse.c:1232:23:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
		retval = get_retval(chmod(real_path, mode));
data/afuse-0.4.1/compat/fuse_opt.c:94: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(newopts + oldlen + 1, opt);
data/afuse-0.4.1/compat/fuse_opt.c:185:7:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
		if (sscanf(param, format, var) != 1) {
data/afuse-0.4.1/compat/fuse_opt.c:234: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(newarg + sep, param);
data/afuse-0.4.1/src/afuse.c:357: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(dir_tmp, mount_point_directory);
data/afuse-0.4.1/src/afuse.c:359:2:  [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(dir_tmp, root_name);
data/afuse-0.4.1/src/afuse.c:423: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(p, mount_point);
data/afuse-0.4.1/src/afuse.c:428: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(p, root_name);
data/afuse-0.4.1/src/afuse.c:458:3:  [4] (shell) execvp:
  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.
		execvp(args[0], args);
data/afuse-0.4.1/src/afuse.c:794:17:  [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.
	if ((browser = popen(pop_cmd, "r")) == NULL) {
data/afuse-0.4.1/src/afuse.c:1455:23:  [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.
		retval = get_retval(access(real_path, mask));
data/afuse-0.4.1/src/afuse.c:1459: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.
			retval = get_retval(access(real_path, mask));
data/afuse-0.4.1/src/afuse.c:1857: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(temp_dir_name, TMP_DIR_TEMPLATE);
data/afuse-0.4.1/src/string_sorted_list.c:17: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(s, str);
data/afuse-0.4.1/src/utils.c:28: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(new_str, str);
data/afuse-0.4.1/compat/fuse_opt.c:233: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(newarg, arg, sep);
data/afuse-0.4.1/src/afuse.c:159:21:  [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 ((filter_file = fopen(filename, "r")) == NULL) {
data/afuse-0.4.1/src/afuse.c:613:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(path_out, mount_point_directory, len);
data/afuse-0.4.1/src/afuse.c:617:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(path_out, path_in + 1, len);
data/afuse-0.4.1/src/afuse.c:1353: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(real_path, fi->flags);
data/afuse-0.4.1/src/afuse.c:1499: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(real_path, fi->flags, mode);
data/afuse-0.4.1/compat/fuse_opt.c:90:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		unsigned oldlen = strlen(*opts);
data/afuse-0.4.1/compat/fuse_opt.c:91:41:  [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).
		newopts = realloc(*opts, oldlen + 1 + strlen(opt) + 1);
data/afuse-0.4.1/compat/fuse_opt.c:140: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).
	int arglen = strlen(arg);
data/afuse-0.4.1/compat/fuse_opt.c:229: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).
	newarg = malloc(sep + strlen(param) + 1);
data/afuse-0.4.1/src/afuse.c:356: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).
	    my_malloc(strlen(mount_point_directory) + 2 + strlen(root_name));
data/afuse-0.4.1/src/afuse.c:356: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).
	    my_malloc(strlen(mount_point_directory) + 2 + strlen(root_name));
data/afuse-0.4.1/src/afuse.c:358:2:  [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(dir_tmp, "/");
data/afuse-0.4.1/src/afuse.c:390: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(mount_point);
data/afuse-0.4.1/src/afuse.c:394: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(root_name);
data/afuse-0.4.1/src/afuse.c:424: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).
				p += strlen(mount_point);
data/afuse-0.4.1/src/afuse.c:429: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).
				p += strlen(root_name);
data/afuse-0.4.1/src/afuse.c:553: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).
	return strlen(mount_point_directory) + strlen(path_in) + 2;
data/afuse-0.4.1/src/afuse.c:553:41:  [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(mount_point_directory) + strlen(path_in) + 2;
data/afuse-0.4.1/src/afuse.c:566: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).
	return strlen(&path[i]);
data/afuse-0.4.1/src/afuse.c:600: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).
	    strlen(root_name) > 0 &&
data/afuse-0.4.1/src/afuse.c:612: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(mount_point_directory);
data/afuse-0.4.1/src/afuse.c:616: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(path_in) - 1;
data/afuse-0.4.1/src/afuse.c:626: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).
	else if (strlen(root_name))
data/afuse-0.4.1/src/afuse.c:634: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:698: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:738: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:822: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(dir_entry) != 0)
data/afuse-0.4.1/src/afuse.c:845: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:912: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:947: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:982: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1011: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1040: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1081: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).
	char *root_name_to = alloca(strlen(to));
data/afuse-0.4.1/src/afuse.c:1110: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).
	char *root_name_from = alloca(strlen(from));
data/afuse-0.4.1/src/afuse.c:1111: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).
	char *root_name_to = alloca(strlen(to));
data/afuse-0.4.1/src/afuse.c:1166: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).
	char *root_name_from = alloca(strlen(from));
data/afuse-0.4.1/src/afuse.c:1167: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).
	char *root_name_to = alloca(strlen(to));
data/afuse-0.4.1/src/afuse.c:1217: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1246: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1275: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1304: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1338: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1405: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1443: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1484: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1532: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1588: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1623: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1656: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1689: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).
	char *root_name = alloca(strlen(path));
data/afuse-0.4.1/src/afuse.c:1856: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).
	char *temp_dir_name = my_malloc(strlen(TMP_DIR_TEMPLATE));
data/afuse-0.4.1/src/afuse.c:1914:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(0);
data/afuse-0.4.1/src/string_sorted_list.c:15: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).
	char *s = malloc((strlen(str) + 1) * sizeof(*s));
data/afuse-0.4.1/src/utils.c:27:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	new_str = my_malloc(strlen(str) + 1);

ANALYSIS SUMMARY:

Hits = 72
Lines analyzed = 3013 in approximately 0.08 seconds (39858 lines/second)
Physical Source Lines of Code (SLOC) = 2359
Hits@level = [0]  40 [1]  50 [2]   6 [3]   0 [4]  14 [5]   2
Hits@level+ = [0+] 112 [1+]  72 [2+]  22 [3+]  16 [4+]  16 [5+]   2
Hits/KSLOC@level+ = [0+] 47.4777 [1+] 30.5214 [2+] 9.32599 [3+] 6.78253 [4+] 6.78253 [5+] 0.847817
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.