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/ondir-0.2.3+git0.55279f03/conf.c
Examining data/ondir-0.2.3+git0.55279f03/conf.h
Examining data/ondir-0.2.3+git0.55279f03/ondir.c

FINAL RESULTS:

data/ondir-0.2.3+git0.55279f03/conf.c:49:5:  [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(section, sol);
data/ondir-0.2.3+git0.55279f03/conf.c:101:7:  [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(tmppath, home);
data/ondir-0.2.3+git0.55279f03/conf.c:102:7:  [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(tmppath, tok + 1);
data/ondir-0.2.3+git0.55279f03/conf.c:133: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, args);
data/ondir-0.2.3+git0.55279f03/conf.c:144: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, args);
data/ondir-0.2.3+git0.55279f03/conf.c:154: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, args);
data/ondir-0.2.3+git0.55279f03/conf.c:163: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, args);
data/ondir-0.2.3+git0.55279f03/conf.c:204:7:  [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(out, val);
data/ondir-0.2.3+git0.55279f03/ondir.c:76: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(working, src);
data/ondir-0.2.3+git0.55279f03/ondir.c:186:21:  [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).
	strcpy(var1, "$"); strcat(var1, var);
data/ondir-0.2.3+git0.55279f03/ondir.c:189:22:  [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).
	strcpy(var2, "${"); strcat(var2, var); strcat(var2, "}");
data/ondir-0.2.3+git0.55279f03/ondir.c:214:3:  [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(out, val);
data/ondir-0.2.3+git0.55279f03/ondir.c:221: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(out, in);
data/ondir-0.2.3+git0.55279f03/ondir.c:282: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(set, var);
data/ondir-0.2.3+git0.55279f03/ondir.c:284: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(set, val);
data/ondir-0.2.3+git0.55279f03/conf.c:51:23:  [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 *home = getenv("HOME");
data/ondir-0.2.3+git0.55279f03/conf.c:196:12:  [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.
					val = getenv(var);
data/ondir-0.2.3+git0.55279f03/ondir.c:64:14:  [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.
	if ((home = getenv("HOME"))) {
data/ondir-0.2.3+git0.55279f03/conf.c:25: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).
	if (!(fp = fopen(file, "r"))) {
data/ondir-0.2.3+git0.55279f03/conf.c:99:6:  [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 tmppath[strlen(tok) + strlen(home) + 1];
data/ondir-0.2.3+git0.55279f03/conf.c:187:4:  [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 var[varlen + 1];
data/ondir-0.2.3+git0.55279f03/ondir.c:17:23:  [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.
int check_regex(const char *regex, const char *line, regmatch_t match[10]);
data/ondir-0.2.3+git0.55279f03/ondir.c:17:42:  [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.
int check_regex(const char *regex, const char *line, regmatch_t match[10]);
data/ondir-0.2.3+git0.55279f03/ondir.c:18:57:  [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.
struct odpath_t *find_path(struct odpath_t *last, const char *path, pathtype_t type, regmatch_t match[10]);
data/ondir-0.2.3+git0.55279f03/ondir.c:29:1:  [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 onenter[PATH_MAX + 1];
data/ondir-0.2.3+git0.55279f03/ondir.c:31:1:  [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 working[PATH_MAX + 1], cwd[PATH_MAX + 1];
data/ondir-0.2.3+git0.55279f03/ondir.c:92:4:  [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 var[4], val[mlen];
data/ondir-0.2.3+git0.55279f03/ondir.c:94:5:  [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(var, "%i", i);
data/ondir-0.2.3+git0.55279f03/ondir.c:104:4:  [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 var[4];
data/ondir-0.2.3+git0.55279f03/ondir.c:106:5:  [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(var, "%i", i);
data/ondir-0.2.3+git0.55279f03/ondir.c:144:4:  [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 var[4], val[mlen];
data/ondir-0.2.3+git0.55279f03/ondir.c:146:5:  [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(var, "%i", i);
data/ondir-0.2.3+git0.55279f03/ondir.c:156:4:  [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 var[4];
data/ondir-0.2.3+git0.55279f03/ondir.c:158:5:  [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(var, "%i", i);
data/ondir-0.2.3+git0.55279f03/ondir.c:189: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(var2, "${"); strcat(var2, var); strcat(var2, "}");
data/ondir-0.2.3+git0.55279f03/ondir.c:231:23:  [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.
int check_regex(const char *regex, const char *line, regmatch_t match[10]) {
data/ondir-0.2.3+git0.55279f03/ondir.c:231:42:  [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.
int check_regex(const char *regex, const char *line, regmatch_t match[10]) {
data/ondir-0.2.3+git0.55279f03/ondir.c:241: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 err_buf[512];
data/ondir-0.2.3+git0.55279f03/ondir.c:254:57:  [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.
struct odpath_t *find_path(struct odpath_t *last, const char *path, pathtype_t type, regmatch_t match[10]) {
data/ondir-0.2.3+git0.55279f03/ondir.c:292:12:  [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 ((fp = fopen(path, "r"))) {
data/ondir-0.2.3+git0.55279f03/ondir.c:293: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[512];
data/ondir-0.2.3+git0.55279f03/conf.c:32: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).
	int line_size = strlen(buffer);
data/ondir-0.2.3+git0.55279f03/conf.c:99:19:  [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 tmppath[strlen(tok) + strlen(home) + 1];
data/ondir-0.2.3+git0.55279f03/conf.c:99: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).
					char tmppath[strlen(tok) + strlen(home) + 1];
data/ondir-0.2.3+git0.55279f03/conf.c:169: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 inlen = strlen(in), outmax = inlen * 2, outlen = 0;
data/ondir-0.2.3+git0.55279f03/conf.c:190:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(var, varstart, varlen);
data/ondir-0.2.3+git0.55279f03/conf.c:198:19:  [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 vallen = strlen(val);
data/ondir-0.2.3+git0.55279f03/ondir.c:77: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(working);
data/ondir-0.2.3+git0.55279f03/ondir.c:95:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(val, working + match[i].rm_so, mlen);
data/ondir-0.2.3+git0.55279f03/ondir.c:133:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(working, dst, len);
data/ondir-0.2.3+git0.55279f03/ondir.c:147:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(val, working + match[i].rm_so, mlen);
data/ondir-0.2.3+git0.55279f03/ondir.c:178: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 inlen = strlen(in), outmax = inlen * 2, varlen = strlen(var), 
data/ondir-0.2.3+git0.55279f03/ondir.c:178:54:  [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 inlen = strlen(in), outmax = inlen * 2, varlen = strlen(var), 
data/ondir-0.2.3+git0.55279f03/ondir.c:179: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).
	vallen = strlen(val), outlen = 0;
data/ondir-0.2.3+git0.55279f03/ondir.c:186:2:  [1] (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 character.
	strcpy(var1, "$"); strcat(var1, var);
data/ondir-0.2.3+git0.55279f03/ondir.c:189:41:  [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.
	strcpy(var2, "${"); strcat(var2, var); strcat(var2, "}");
data/ondir-0.2.3+git0.55279f03/ondir.c:208:3:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
		strncat(out, in, offset - in);
data/ondir-0.2.3+git0.55279f03/ondir.c:251:65:  [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 retval == 0 && match[0].rm_so == 0 && match[0].rm_eo == strlen(line);
data/ondir-0.2.3+git0.55279f03/ondir.c:269:23:  [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).
					match[0].rm_eo = strlen(path);
data/ondir-0.2.3+git0.55279f03/ondir.c:280: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 *set = malloc(strlen(var) + strlen(val) + 2);
data/ondir-0.2.3+git0.55279f03/ondir.c:280: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 *set = malloc(strlen(var) + strlen(val) + 2);
data/ondir-0.2.3+git0.55279f03/ondir.c:283: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(set, "=");

ANALYSIS SUMMARY:

Hits = 62
Lines analyzed = 591 in approximately 0.04 seconds (14161 lines/second)
Physical Source Lines of Code (SLOC) = 450
Hits@level = [0]  15 [1]  21 [2]  23 [3]   3 [4]  15 [5]   0
Hits@level+ = [0+]  77 [1+]  62 [2+]  41 [3+]  18 [4+]  15 [5+]   0
Hits/KSLOC@level+ = [0+] 171.111 [1+] 137.778 [2+] 91.1111 [3+]  40 [4+] 33.3333 [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.