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/blkreplay-1.0/src/bins.c
Examining data/blkreplay-1.0/src/blkreplay.c
Examining data/blkreplay-1.0/src/random_data.c

FINAL RESULTS:

data/blkreplay-1.0/src/blkreplay.c:1443:17:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	char *tmpdir = getenv("TMPDIR");
data/blkreplay-1.0/src/blkreplay.c:1474:16:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
		char *file = getenv("VERIFY_TABLE");
data/blkreplay-1.0/src/blkreplay.c:1486:16:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
		char *file = getenv("COMPLETION_TABLE");
data/blkreplay-1.0/src/random_data.c:42:10:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
# define random rand
data/blkreplay-1.0/src/random_data.c:60:11:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
			*ptr = random();
data/blkreplay-1.0/src/bins.c:61: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[4096];
data/blkreplay-1.0/src/blkreplay.c:698:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(tag, &rq->tag, sizeof(*tag));
data/blkreplay-1.0/src/blkreplay.c:1424: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).
	main_fd = open(main_name, flags);
data/blkreplay-1.0/src/blkreplay.c:1478:15:  [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).
		verify_fd = open(file, flags, S_IRUSR | S_IWUSR);
data/blkreplay-1.0/src/blkreplay.c:1490:17:  [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).
		complete_fd = open(file, flags, S_IRUSR | S_IWUSR);
data/blkreplay-1.0/src/blkreplay.c:1572: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 buf[CP_SIZE];
data/blkreplay-1.0/src/blkreplay.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 buffer[4096];
data/blkreplay-1.0/src/random_data.c:52:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char buf[SIZE];
data/blkreplay-1.0/src/blkreplay.c:98:54:  [1] (free) memalign:
  On some systems (though not Linux-based systems) an attempt to free()
  results from memalign() may fail. This may, on a few systems, be
  exploitable. Also note that memalign() may not check that the boundary
  parameter is correct (CWE-676). Use posix_memalign instead (defined in
  POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD
  4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases,
  malloc()'s alignment may be sufficient.
#  define posix_memalign(res,align,size) ((*(res)) = memalign((align), (size)), 0)
data/blkreplay-1.0/src/blkreplay.c:497:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	return read(main_fd, buffer, len);
data/blkreplay-1.0/src/blkreplay.c:548:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	status = read(fd, data, memlen);
data/blkreplay-1.0/src/blkreplay.c:734:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		status = read(verify_fd, table, TAG_CHUNK);
data/blkreplay-1.0/src/blkreplay.c:742:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		status = read(complete_fd, table2, TAG_CHUNK);
data/blkreplay-1.0/src/blkreplay.c:1014:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	int status = read(fd, data, len);
data/blkreplay-1.0/src/blkreplay.c:2260:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		len = strlen(tmp->arg_name);
data/blkreplay-1.0/src/blkreplay.c:2299:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			int len = strlen(tmp->arg_name);

ANALYSIS SUMMARY:

Hits = 21
Lines analyzed = 2622 in approximately 0.11 seconds (23939 lines/second)
Physical Source Lines of Code (SLOC) = 2057
Hits@level = [0] 125 [1]   8 [2]   8 [3]   5 [4]   0 [5]   0
Hits@level+ = [0+] 146 [1+]  21 [2+]  13 [3+]   5 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 70.9772 [1+] 10.209 [2+] 6.31988 [3+] 2.43072 [4+]   0 [5+]   0
Symlinks skipped = 1 (--allowlink overrides but see doc for security issue)
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.