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/madfuload-1.2/madfuload.c

FINAL RESULTS:

data/madfuload-1.2/madfuload.c:97:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vfprintf(stderr, format, ap);
data/madfuload-1.2/madfuload.c:347: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 *device = getenv("DEVICE");
data/madfuload-1.2/madfuload.c:351: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 ((c = getopt_long(argc, argv, short_options,
data/madfuload-1.2/madfuload.c:167: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).
	int fd = open(filename, O_RDONLY);
data/madfuload-1.2/madfuload.c:200:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			unsigned char d[7];
data/madfuload-1.2/madfuload.c:216:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			unsigned char d[5];
data/madfuload-1.2/madfuload.c:285: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).
	device = open(device_file, O_RDWR);
data/madfuload-1.2/madfuload.c:179:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(fd, firmware, firmware_length) != firmware_length)
data/madfuload-1.2/madfuload.c:192:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(device, &desc, 2) != 2)
data/madfuload-1.2/madfuload.c:201:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(device, d, 7) != 7)
data/madfuload-1.2/madfuload.c:218:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(device, d, 5) != 5)

ANALYSIS SUMMARY:

Hits = 11
Lines analyzed = 400 in approximately 0.02 seconds (17541 lines/second)
Physical Source Lines of Code (SLOC) = 343
Hits@level = [0]   3 [1]   4 [2]   4 [3]   2 [4]   1 [5]   0
Hits@level+ = [0+]  14 [1+]  11 [2+]   7 [3+]   3 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 40.8163 [1+] 32.07 [2+] 20.4082 [3+] 8.74636 [4+] 2.91545 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.