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/dctrl-tools-2.24/grep-dctrl/grep-dctrl.c
Examining data/dctrl-tools-2.24/join-dctrl/join-dctrl.c
Examining data/dctrl-tools-2.24/lib/align.h
Examining data/dctrl-tools-2.24/lib/atom.c
Examining data/dctrl-tools-2.24/lib/atom.h
Examining data/dctrl-tools-2.24/lib/fieldtrie.c
Examining data/dctrl-tools-2.24/lib/fieldtrie.h
Examining data/dctrl-tools-2.24/lib/fnutil.c
Examining data/dctrl-tools-2.24/lib/fnutil.h
Examining data/dctrl-tools-2.24/lib/fsaf.c
Examining data/dctrl-tools-2.24/lib/fsaf.h
Examining data/dctrl-tools-2.24/lib/i18n.h
Examining data/dctrl-tools-2.24/lib/ifile.c
Examining data/dctrl-tools-2.24/lib/ifile.h
Examining data/dctrl-tools-2.24/lib/misc.c
Examining data/dctrl-tools-2.24/lib/misc.h
Examining data/dctrl-tools-2.24/lib/msg.c
Examining data/dctrl-tools-2.24/lib/msg.h
Examining data/dctrl-tools-2.24/lib/para_bundle.c
Examining data/dctrl-tools-2.24/lib/para_bundle.h
Examining data/dctrl-tools-2.24/lib/para_pool.c
Examining data/dctrl-tools-2.24/lib/para_pool.h
Examining data/dctrl-tools-2.24/lib/paragraph.c
Examining data/dctrl-tools-2.24/lib/paragraph.h
Examining data/dctrl-tools-2.24/lib/predicate.c
Examining data/dctrl-tools-2.24/lib/predicate.h
Examining data/dctrl-tools-2.24/lib/sorter.c
Examining data/dctrl-tools-2.24/lib/sorter.h
Examining data/dctrl-tools-2.24/lib/strlist.c
Examining data/dctrl-tools-2.24/lib/strlist.h
Examining data/dctrl-tools-2.24/lib/strutil.c
Examining data/dctrl-tools-2.24/lib/strutil.h
Examining data/dctrl-tools-2.24/lib/util.c
Examining data/dctrl-tools-2.24/lib/util.h
Examining data/dctrl-tools-2.24/lib/version.c
Examining data/dctrl-tools-2.24/lib/version.h
Examining data/dctrl-tools-2.24/sort-dctrl/sort-dctrl.c
Examining data/dctrl-tools-2.24/tbl-dctrl/tbl-dctrl.c

FINAL RESULTS:

data/dctrl-tools-2.24/lib/fnutil.c:80:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(res, "%s/%s", cwd, path);
data/dctrl-tools-2.24/lib/fnutil.c:121:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(result, "%s/%s", pwd->pw_dir, p);
data/dctrl-tools-2.24/lib/ifile.c:57:3:  [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("/bin/sh", "/bin/sh", "-c", s, (char*)0);
data/dctrl-tools-2.24/lib/misc.c:42:14:  [4] (shell) popen:
  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.
		FILE * p = popen(cmd, "w");
data/dctrl-tools-2.24/lib/msg.c:102:9:  [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/dctrl-tools-2.24/lib/msg.h:79:31:  [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.
        __attribute__((format(printf,4,5)));
data/dctrl-tools-2.24/lib/msg.h:95:31:  [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.
        __attribute__((format(printf,3,4)));
data/dctrl-tools-2.24/lib/msg.h:122:50:  [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.
debug(const char * s, ...) __attribute__((format(printf, 1, 2)));
data/dctrl-tools-2.24/lib/msg.h:132: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, s, va);
data/dctrl-tools-2.24/lib/misc.c:34: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 * cmd = getenv("PAGER");
data/dctrl-tools-2.24/grep-dctrl/grep-dctrl.c:172: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.
        char * strings[MAX_TOKS];
data/dctrl-tools-2.24/lib/fnutil.c:103: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(username, path+1, size);
data/dctrl-tools-2.24/lib/fsaf.h:100: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(rv, r.b, r.len);
data/dctrl-tools-2.24/lib/ifile.c:75: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(f.s, O_RDONLY);
data/dctrl-tools-2.24/lib/misc.c:52: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 (fname, "r");
data/dctrl-tools-2.24/lib/msg.c:34: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 progname [PROGNAME_MAXLEN];
data/dctrl-tools-2.24/lib/predicate.c:119: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.
        char ind[indent+1];
data/dctrl-tools-2.24/grep-dctrl/grep-dctrl.c:678:32:  [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).
                atom->patlen = strlen(pattern);
data/dctrl-tools-2.24/lib/atom.c:31:36:  [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 regex_patlen = atom->patlen + strlen(RE_PKG_BEGIN)
data/dctrl-tools-2.24/lib/atom.c:32:7:  [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(RE_PKG_END) + 1;
data/dctrl-tools-2.24/lib/atom.c:49:4:  [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(regex_pat, RE_PKG_BEGIN, strlen(RE_PKG_BEGIN));
data/dctrl-tools-2.24/lib/atom.c:49:37:  [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).
			strncat(regex_pat, RE_PKG_BEGIN, strlen(RE_PKG_BEGIN));
data/dctrl-tools-2.24/lib/atom.c:50: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(regex_pat, atom->pat, atom->patlen);
data/dctrl-tools-2.24/lib/atom.c:52:4:  [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(regex_pat, RE_PKG_END, strlen(RE_PKG_END));
data/dctrl-tools-2.24/lib/atom.c:52:35:  [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).
			strncat(regex_pat, RE_PKG_END, strlen(RE_PKG_END));
data/dctrl-tools-2.24/lib/fieldtrie.c:57:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(name, s, slen);
data/dctrl-tools-2.24/lib/fieldtrie.c:74:38:  [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 fieldtrie_insert_n(s, strlen(s));
data/dctrl-tools-2.24/lib/fnutil.c:73: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(cwd);
data/dctrl-tools-2.24/lib/fnutil.c:74: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).
		size = len + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
data/dctrl-tools-2.24/lib/fnutil.c:118: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).
	size = strlen(pwd->pw_dir) + 1 + strlen(p) + 1;
data/dctrl-tools-2.24/lib/fnutil.c:118:35:  [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).
	size = strlen(pwd->pw_dir) + 1 + strlen(p) + 1;
data/dctrl-tools-2.24/lib/fsaf.c:116:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		res = read(fp->fd, fp->buf + fp->buf_size, fp->buf_capacity - fp->buf_size);
data/dctrl-tools-2.24/lib/fsaf.c:152:16:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((ch = getchar()) != EOF) {
data/dctrl-tools-2.24/lib/misc.c:58:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ( ( c = getc (f)) != EOF) putc(c, t);
data/dctrl-tools-2.24/lib/msg.c:60:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy (progname, pn, PROGNAME_MAXLEN);
data/dctrl-tools-2.24/lib/sorter.c:45:38:  [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).
			bool aok = parse_version(&ar, af, strlen(af));
data/dctrl-tools-2.24/lib/sorter.c:46:38:  [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).
			bool bok = parse_version(&br, bf, strlen(bf));
data/dctrl-tools-2.24/lib/strutil.c:71: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).
	size_t sl = strlen(s);
data/dctrl-tools-2.24/tbl-dctrl/tbl-dctrl.c:157:25:  [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).
		data[i].wrapped_len = strlen(data[i].wrapped);
data/dctrl-tools-2.24/tbl-dctrl/tbl-dctrl.c:222:42:  [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).
                        columns[i].len = strlen(columns[i].b);
data/dctrl-tools-2.24/tbl-dctrl/tbl-dctrl.c:348: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).
	if (n == (size_t)(-1)) n = strlen(mbs);

ANALYSIS SUMMARY:

Hits = 41
Lines analyzed = 5283 in approximately 0.22 seconds (23509 lines/second)
Physical Source Lines of Code (SLOC) = 3802
Hits@level = [0]  34 [1]  24 [2]   7 [3]   1 [4]   9 [5]   0
Hits@level+ = [0+]  75 [1+]  41 [2+]  17 [3+]  10 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 19.7265 [1+] 10.7838 [2+] 4.47133 [3+] 2.63019 [4+] 2.36718 [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.