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/i3blocks-1.4/include/bar.h
Examining data/i3blocks-1.4/include/block.h
Examining data/i3blocks-1.4/include/click.h
Examining data/i3blocks-1.4/include/ini.h
Examining data/i3blocks-1.4/include/io.h
Examining data/i3blocks-1.4/include/json.h
Examining data/i3blocks-1.4/include/log.h
Examining data/i3blocks-1.4/include/sched.h
Examining data/i3blocks-1.4/src/bar.c
Examining data/i3blocks-1.4/src/block.c
Examining data/i3blocks-1.4/src/click.c
Examining data/i3blocks-1.4/src/ini.c
Examining data/i3blocks-1.4/src/io.c
Examining data/i3blocks-1.4/src/json.c
Examining data/i3blocks-1.4/src/main.c
Examining data/i3blocks-1.4/src/sched.c

FINAL RESULTS:

data/i3blocks-1.4/src/block.c:99:2:  [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.
	execl(shell, shell, "-c", COMMAND(block), (char *) NULL);
data/i3blocks-1.4/src/block.c:149: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(props->name, NAME(block));
data/i3blocks-1.4/src/block.c:150: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(props->instance, INSTANCE(block));
data/i3blocks-1.4/src/block.c:226: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(props->full_text, concat);
data/i3blocks-1.4/src/ini.c:209:28:  [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.
	const char * const home = getenv("HOME");
data/i3blocks-1.4/src/ini.c:210:32:  [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.
	const char * const xdg_home = getenv("XDG_CONFIG_HOME");
data/i3blocks-1.4/src/ini.c:211:32:  [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.
	const char * const xdg_dirs = getenv("XDG_CONFIG_DIRS");
data/i3blocks-1.4/src/main.c:46:13:  [3] (buffer) getopt:
  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(argc, argv, "c:vhV"), c != -1) {
data/i3blocks-1.4/include/block.h:62:38:  [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.
#define DEFINE(_name, _size, _flags) char _name[_size];
data/i3blocks-1.4/src/bar.c:48: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 json[1024] = { 0 };
data/i3blocks-1.4/src/block.c:108: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[2048] = { 0 };
data/i3blocks-1.4/src/block.c:153: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(props->color, "#FF0000");
data/i3blocks-1.4/src/block.c:154: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(props->urgent, "true");
data/i3blocks-1.4/src/block.c:193: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[2048] = { 0 };
data/i3blocks-1.4/src/block.c:215: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(props, &block->default_props, sizeof(struct properties));
data/i3blocks-1.4/src/block.c:224: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 concat[size];
data/i3blocks-1.4/src/block.c:321: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 reason[32];
data/i3blocks-1.4/src/block.c:324:4:  [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(reason, "internal error");
data/i3blocks-1.4/src/block.c:326:4:  [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(reason, "bad exit code %d", code);
data/i3blocks-1.4/src/block.c:341:3:  [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(block->updated_props.urgent, "true");
data/i3blocks-1.4/src/block.c:362:21:  [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).
		block->interval = atoi(defaults->interval);
data/i3blocks-1.4/src/block.c:369:18:  [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).
	block->signal = atoi(defaults->signal);
data/i3blocks-1.4/src/block.c:372: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(updated, defaults, sizeof(struct properties));
data/i3blocks-1.4/src/ini.c:67: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(name, line + 1, len - 2);
data/i3blocks-1.4/src/ini.c:105: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 line[2048];
data/i3blocks-1.4/src/ini.c:140: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(block, &global, sizeof(struct block));
data/i3blocks-1.4/src/ini.c:184: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 *fp = fopen(path, "r");
data/i3blocks-1.4/src/ini.c:212: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];
data/i3blocks-1.4/src/json.c:105: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 key[keylen + 1];
data/i3blocks-1.4/src/block.c:111:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(block->err, buf, sizeof(buf) - 1) == -1) {
data/i3blocks-1.4/src/block.c:131:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(dest, *lines, size);
data/i3blocks-1.4/src/block.c:132: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).
		*lines += strlen(dest);
data/i3blocks-1.4/src/block.c:179:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(props->_name, buf + start, size); \
data/i3blocks-1.4/src/block.c:208:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(block->out, buf, sizeof(buf) - 1) == -1) {
data/i3blocks-1.4/src/ini.c:54: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).
	const int len = strlen(line);
data/i3blocks-1.4/src/ini.c:78:7:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
	if (!equal) {
data/i3blocks-1.4/src/ini.c:90:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(props->_name, value, _size - 1); \
data/i3blocks-1.4/src/ini.c:115: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(line);
data/i3blocks-1.4/src/io.c:63:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	nr = read(fd, buf, size);
data/i3blocks-1.4/src/json.c:104: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).
	const size_t keylen = strlen(name) + 2;

ANALYSIS SUMMARY:

Hits = 40
Lines analyzed = 1710 in approximately 0.10 seconds (17173 lines/second)
Physical Source Lines of Code (SLOC) = 1043
Hits@level = [0]  26 [1]  11 [2]  21 [3]   4 [4]   4 [5]   0
Hits@level+ = [0+]  66 [1+]  40 [2+]  29 [3+]   8 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 63.279 [1+] 38.3509 [2+] 27.8044 [3+] 7.67018 [4+] 3.83509 [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.