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/adcli-0.9.0/library/adattrs.c
Examining data/adcli-0.9.0/library/adattrs.h
Examining data/adcli-0.9.0/library/adcli.h
Examining data/adcli-0.9.0/library/adconn.c
Examining data/adcli-0.9.0/library/adconn.h
Examining data/adcli-0.9.0/library/addisco.c
Examining data/adcli-0.9.0/library/addisco.h
Examining data/adcli-0.9.0/library/adenroll.c
Examining data/adcli-0.9.0/library/adenroll.h
Examining data/adcli-0.9.0/library/adentry.c
Examining data/adcli-0.9.0/library/adentry.h
Examining data/adcli-0.9.0/library/adkrb5.c
Examining data/adcli-0.9.0/library/adldap.c
Examining data/adcli-0.9.0/library/adprivate.h
Examining data/adcli-0.9.0/library/adutil.c
Examining data/adcli-0.9.0/library/adutil.h
Examining data/adcli-0.9.0/library/seq.c
Examining data/adcli-0.9.0/library/seq.h
Examining data/adcli-0.9.0/library/test.c
Examining data/adcli-0.9.0/library/test.h
Examining data/adcli-0.9.0/tools/computer.c
Examining data/adcli-0.9.0/tools/entry.c
Examining data/adcli-0.9.0/tools/info.c
Examining data/adcli-0.9.0/tools/tools.c
Examining data/adcli-0.9.0/tools/tools.h

FINAL RESULTS:

data/adcli-0.9.0/library/adutil.c:52: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, message, va);
data/adcli-0.9.0/library/adutil.c:100:8:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	ret = vsnprintf (where, sizeof (buffer), format, va);
data/adcli-0.9.0/library/adutil.c:569:8:  [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.
	ret = access (binary, X_OK);
data/adcli-0.9.0/library/adutil.c:615:3:  [4] (shell) execv:
  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.
		execv (binary, argv);
data/adcli-0.9.0/library/test.c:152:2:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	vsnprintf (item.x.test.name, sizeof (item.x.test.name), name, va);
data/adcli-0.9.0/library/test.c:172:2:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	vsnprintf (item.x.test.name, sizeof (item.x.test.name), name, va);
data/adcli-0.9.0/tools/computer.c:287:9:  [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.
		ret = access (optarg, X_OK);
data/adcli-0.9.0/tools/tools.c:216:13:  [4] (misc) getpass:
  This function is obsolete and not portable. It was in SUSv2 but removed by
  POSIX.2. What it does exactly varies considerably between systems,
  particularly in where its prompt is displayed and where it gets its data
  (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations
  overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do
  exactly what you want. If you continue to use it, or write your own, be
  sure to zero the password as soon as possible to avoid leaving the
  cleartext password visible in the process' address space.
	password = getpass (prompt);
data/adcli-0.9.0/library/adutil.c:55: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 ("ADCLI_STRICT");
data/adcli-0.9.0/tools/tools.c:185:8:  [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.
	ret = getopt_long (argc, argv, shorts, options, NULL);
data/adcli-0.9.0/tools/tools.c:314: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.
	krb5_conf = getenv ("KRB5_CONFIG");
data/adcli-0.9.0/tools/tools.c:318:11:  [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.
	parent = getenv ("TMPDIR");
data/adcli-0.9.0/library/adconn.c:117: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 hostname[HOST_NAME_MAX + 1];
data/adcli-0.9.0/library/adconn.c:429:7:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	fd = mkstemp (filename);
data/adcli-0.9.0/library/addisco.c:158: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[HOST_NAME_MAX];
data/adcli-0.9.0/library/addisco.c:510:8:  [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.
	const char *addrs[DISCO_COUNT];
data/adcli-0.9.0/library/addisco.c:513: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[1024];
data/adcli-0.9.0/library/adenroll.c:2627: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[8];
data/adcli-0.9.0/library/adenroll.c:2629: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 (PROC_SYS_FIPS, O_RDONLY);
data/adcli-0.9.0/library/adenroll.c:2718: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 (newval, value, sizeof (krb5_enctype) * (len + 1));
data/adcli-0.9.0/library/adkrb5.c:473: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 (salt->data + at, "host", 4);
data/adcli-0.9.0/library/adkrb5.c:482: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 (salt->data + at, ".", 1);
data/adcli-0.9.0/library/adldap.c:296: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 (out, in, pos);
data/adcli-0.9.0/library/adutil.c:42:8:  [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.
static char last_error[2048] = { 0, };
data/adcli-0.9.0/library/adutil.c:91: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[sizeof (last_error)];
data/adcli-0.9.0/library/adutil.c:189: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 (result + at, delim, dlen);
data/adcli-0.9.0/library/adutil.c:193: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 (result + at, strv[i], slen);
data/adcli-0.9.0/library/adutil.c:380: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 (&val, data + p, sizeof (uint32_t));
data/adcli-0.9.0/library/adutil.c:424: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 (result, data, len);
data/adcli-0.9.0/library/adutil.c:654:5:  [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 (out, read_buf, rlen);
data/adcli-0.9.0/library/seq.c:573:8:  [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).
	val = atoi (value);
data/adcli-0.9.0/library/seq.c:667: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 lookup[2] = { 0, 0 };
data/adcli-0.9.0/library/test.c:60: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 name[1024];
data/adcli-0.9.0/library/test.c:132: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 (item, it, sizeof (test_item));
data/adcli-0.9.0/tools/tools.c:358:8:  [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).
		fo = fopen (filename, "wb");
data/adcli-0.9.0/library/adconn.c:241:6:  [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 (strlen (computer_name) > 15) {
data/adcli-0.9.0/library/adconn.c:428:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	old_mask = umask (0177);
data/adcli-0.9.0/library/adconn.c:430:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask (old_mask);
data/adcli-0.9.0/library/adconn.c:943: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).
			in->len = strlen (in->result);
data/adcli-0.9.0/library/adconn.c:950: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).
			in->len = strlen (in->result);
data/adcli-0.9.0/library/adenroll.c:567:15:  [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).
	prefix_len = strlen (prefix);
data/adcli-0.9.0/library/adenroll.c:1559: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 (realm);
data/adcli-0.9.0/library/adenroll.c:1566: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 (name);
data/adcli-0.9.0/library/adenroll.c:1781:21:  [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).
		password.length = strlen (enroll->computer_password);
data/adcli-0.9.0/library/adenroll.c:2631:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		len = read (fd, buf, sizeof (buf));
data/adcli-0.9.0/library/adentry.c:195:15:  [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).
	prefix_len = strlen (prefix);
data/adcli-0.9.0/library/adkrb5.c:456:16:  [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).
	host_length = strlen (host_netbios);
data/adcli-0.9.0/library/adldap.c:236: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).
		vals[i].bv_len = strlen (vals[i].bv_val);
data/adcli-0.9.0/library/adldap.c:286: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 (value);
data/adcli-0.9.0/library/adutil.c:183: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).
	dlen = strlen (delim);
data/adcli-0.9.0/library/adutil.c:185:10:  [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).
		slen = strlen (strv[i]);
data/adcli-0.9.0/library/adutil.c:433:15:  [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 len = strlen (str);
data/adcli-0.9.0/library/adutil.c:434: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 lp = strlen (prefix);
data/adcli-0.9.0/library/adutil.c:442:15:  [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 len = strlen (str);
data/adcli-0.9.0/library/adutil.c:443: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 ls = strlen (suffix);
data/adcli-0.9.0/library/adutil.c:455: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).
	ret = adcli_mem_clear (password, strlen (password));
data/adcli-0.9.0/library/adutil.c:494: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 (buf);
data/adcli-0.9.0/library/adutil.c:622:10:  [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 (stdin_data);
data/adcli-0.9.0/library/adutil.c:638:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			rlen = read (pipefd_from_child[0], read_buf, sizeof (read_buf));
data/adcli-0.9.0/tools/tools.c:223: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).
	adcli_mem_clear (password, strlen (password));
data/adcli-0.9.0/tools/tools.c:246:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		res = read (0, buffer + offset, length - offset);
data/adcli-0.9.0/tools/tools.c:330: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).
	              (parent[0] && parent[strlen(parent) - 1] == '/') ? "" : "/") < 0) {
data/adcli-0.9.0/tools/tools.c:363: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).
			fwrite (contents, 1, strlen (contents), fo);

ANALYSIS SUMMARY:

Hits = 63
Lines analyzed = 13205 in approximately 0.30 seconds (44133 lines/second)
Physical Source Lines of Code (SLOC) = 10015
Hits@level = [0]  76 [1]  28 [2]  23 [3]   4 [4]   8 [5]   0
Hits@level+ = [0+] 139 [1+]  63 [2+]  35 [3+]  12 [4+]   8 [5+]   0
Hits/KSLOC@level+ = [0+] 13.8792 [1+] 6.29056 [2+] 3.49476 [3+] 1.1982 [4+] 0.798802 [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.