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/fwupdate-12/efi/dumpesrt.c
Examining data/fwupdate-12/efi/dumpf.c
Examining data/fwupdate-12/efi/fakeesrt.c
Examining data/fwupdate-12/efi/fakeesrt2.c
Examining data/fwupdate-12/efi/fwupdate.c
Examining data/fwupdate-12/efi/hexdump.h
Examining data/fwupdate-12/efi/mkvar.c
Examining data/fwupdate-12/efi/mkvar2.c
Examining data/fwupdate-12/include/fwup-efi.h
Examining data/fwupdate-12/linux/error.h
Examining data/fwupdate-12/linux/fix_coverity.h
Examining data/fwupdate-12/linux/fwupdate.c
Examining data/fwupdate-12/linux/include/dell-wmi-smi.h
Examining data/fwupdate-12/linux/include/fwup.h
Examining data/fwupdate-12/linux/libfwup.c
Examining data/fwupdate-12/linux/tester.c
Examining data/fwupdate-12/linux/ucs2.h
Examining data/fwupdate-12/linux/util.h

FINAL RESULTS:

data/fwupdate-12/linux/error.h:82:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, fmt, ap);
data/fwupdate-12/linux/error.h:99:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, fmt, ap);
data/fwupdate-12/linux/error.h:115:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, fmt, ap);
data/fwupdate-12/linux/error.h:132:2:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vprintf(fmt, ap);
data/fwupdate-12/linux/error.h:147:2:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vprintf(fmt, ap);
data/fwupdate-12/linux/error.h:161:2:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vprintf(fmt, ap);
data/fwupdate-12/linux/libfwup.c:74: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(_ret, _alt_dir?_alt_dir:_esrt_dir);	\
data/fwupdate-12/linux/libfwup.c:124: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(DELL_WMI_CHAR, F_OK) != -1)
data/fwupdate-12/linux/util.h:31:4:  [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.
			printf((fmt), ## args);				\
data/fwupdate-12/linux/libfwup.c:69:20:  [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 *_alt_dir = getenv("LIBFWUP_ESRT_DIR");		\
data/fwupdate-12/linux/libfwup.c:699:8:  [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.
	env = getenv("LIBFWUP_ADD_UX_CAPSULE");
data/fwupdate-12/linux/fwupdate.c:385: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).
			int fd = open(filename, O_RDONLY);
data/fwupdate-12/linux/libfwup.c:75: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(_ret, "entries/");			\
data/fwupdate-12/linux/libfwup.c:135: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(DELL_WMI_CHAR, O_NONBLOCK);
data/fwupdate-12/linux/libfwup.c:153:6:  [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).
	f = fopen(DELL_WMI_CHAR, "rb");
data/fwupdate-12/linux/libfwup.c:168: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 value_sysfs[sizeof("ffff_value")];
data/fwupdate-12/linux/libfwup.c:169: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 location_sysfs[sizeof("ffff_location")];
data/fwupdate-12/linux/libfwup.c:171:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(value_sysfs, "%04hhx_value", token);
data/fwupdate-12/linux/libfwup.c:172:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(location_sysfs, "%04hhx_location", token);
data/fwupdate-12/linux/libfwup.c:571: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(dp, local->dp_buf, (size_t)sz);
data/fwupdate-12/linux/libfwup.c:627: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(info2, info, sizeof(*info));
data/fwupdate-12/linux/libfwup.c:628: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(info2->dp_buf, info->dp_ptr, dps);
data/fwupdate-12/linux/libfwup.c:1174:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(new_boot_order, boot_order, boot_order_size);
data/fwupdate-12/linux/libfwup.c:1404:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(boot_next_name, "Boot%04hX", boot_next & 0xffff);
data/fwupdate-12/linux/libfwup.c:1561: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(fullpath, O_CREAT|O_TRUNC|O_CLOEXEC|O_RDWR, 0600);
data/fwupdate-12/linux/libfwup.c:1685: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(&ui32, buf+10, 4);
data/fwupdate-12/linux/libfwup.c:1689: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(&ui32, buf+14, 4);
data/fwupdate-12/linux/libfwup.c:1693: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(width, buf+18, 4);
data/fwupdate-12/linux/libfwup.c:1694: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(height, buf+22, 4);
data/fwupdate-12/linux/util.h:191: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(__newbuf, buf, len);				\
data/fwupdate-12/linux/libfwup.c:72: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).
			_ret = alloca(strlen(_alt_dir?_alt_dir:_esrt_dir) \
data/fwupdate-12/linux/libfwup.c:73: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).
				      + strlen("entries/") + 1);	\
data/fwupdate-12/linux/libfwup.c:150:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	size_t read;
data/fwupdate-12/linux/libfwup.c:160:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read != 1)
data/fwupdate-12/linux/libfwup.c:481:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	guidstr = onstack(guidstr, strlen(guidstr)+1);
data/fwupdate-12/linux/libfwup.c:488:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	varname = onstack(varname, strlen(varname)+1);
data/fwupdate-12/linux/libfwup.c:594:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	guidstr = onstack(guidstr, strlen(guidstr)+1);
data/fwupdate-12/linux/libfwup.c:601:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	varname = onstack(varname, strlen(varname)+1);
data/fwupdate-12/linux/util.h:60:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		s = read(fd, p, size - filesize);
data/fwupdate-12/linux/util.h:120:7:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = fgetc(fin);
data/fwupdate-12/linux/util.h:247:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			*(outpath) = onstack(__path, strlen(__path)+1);	\

ANALYSIS SUMMARY:

Hits = 41
Lines analyzed = 5482 in approximately 0.14 seconds (38049 lines/second)
Physical Source Lines of Code (SLOC) = 4329
Hits@level = [0]  29 [1]  11 [2]  19 [3]   2 [4]   9 [5]   0
Hits@level+ = [0+]  70 [1+]  41 [2+]  30 [3+]  11 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 16.17 [1+] 9.47101 [2+] 6.93001 [3+] 2.541 [4+] 2.079 [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.