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/ldapvi-1.7/print.c
Examining data/ldapvi-1.7/error.c
Examining data/ldapvi-1.7/sasl.c
Examining data/ldapvi-1.7/search.c
Examining data/ldapvi-1.7/data.c
Examining data/ldapvi-1.7/schema.c
Examining data/ldapvi-1.7/parseldif.c
Examining data/ldapvi-1.7/version.h
Examining data/ldapvi-1.7/diff.c
Examining data/ldapvi-1.7/parse.c
Examining data/ldapvi-1.7/base64.c
Examining data/ldapvi-1.7/port.c
Examining data/ldapvi-1.7/arguments.c
Examining data/ldapvi-1.7/common.h
Examining data/ldapvi-1.7/misc.c
Examining data/ldapvi-1.7/ldapvi.c

FINAL RESULTS:

data/ldapvi-1.7/ldapvi.c:715: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(url + 7, server);
data/ldapvi-1.7/misc.c:177:4:  [4] (shell) execlp:
  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.
			execlp(vi, vi, buf, pathname, 0);
data/ldapvi-1.7/misc.c:179:4:  [4] (shell) execlp:
  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.
			execlp(vi, vi, pathname, 0);
data/ldapvi-1.7/misc.c:220:3:  [4] (shell) execlp:
  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.
		execlp(pg, pg, pathname, 0);
data/ldapvi-1.7/misc.c:252:3:  [4] (shell) execlp:
  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.
		execlp(pg, pg, 0);
data/ldapvi-1.7/misc.c:285: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(result, home);
data/ldapvi-1.7/misc.c:287: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(result + n + 1, name);
data/ldapvi-1.7/misc.c:394: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(result, a);
data/ldapvi-1.7/misc.c:395: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(result + k, b);
data/ldapvi-1.7/misc.c:658: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(str + max - len, prompt);
data/ldapvi-1.7/parse.c:156:9:  [4] (crypto) crypt:
  The crypt functions use a poor one-way hashing algorithm; since they only
  accept passwords of 8 characters or fewer and only a two-byte salt, they
  are excessively vulnerable to dictionary attacks given today's faster
  computing equipment (CWE-327). Use a different algorithm, such as SHA-256,
  with a larger, non-repeating salt.
	return crypt(key, (char *) salt);
data/ldapvi-1.7/parse.c:177:11:  [4] (crypto) crypt:
  The crypt functions use a poor one-way hashing algorithm; since they only
  accept passwords of 8 characters or fewer and only a two-byte salt, they
  are excessively vulnerable to dictionary attacks given today's faster
  computing equipment (CWE-327). Use a different algorithm, such as SHA-256,
  with a larger, non-repeating salt.
	result = crypt(key, (char *) salt);
data/ldapvi-1.7/parseldif.c:314: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(dn, newrdn);
data/ldapvi-1.7/parseldif.c:315: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(dn + i, komma);
data/ldapvi-1.7/parseldif.c:328: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(dn, newrdn);
data/ldapvi-1.7/parseldif.c:330: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(dn + i + 1, tmp2->str);
data/ldapvi-1.7/search.c:51:2:  [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((n == 1) ? "\r%7d entry read  " :"\r%7d entries read", n);
data/ldapvi-1.7/misc.c:164:7:  [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.
	vi = getenv("VISUAL");
data/ldapvi-1.7/misc.c:165: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.
	if (!vi) vi = getenv("EDITOR");
data/ldapvi-1.7/misc.c:208:7:  [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.
	pg = getenv("PAGER");
data/ldapvi-1.7/misc.c:237:7:  [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.
	pg = getenv("PAGER");
data/ldapvi-1.7/misc.c:274:15:  [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 *home = getenv("HOME");
data/ldapvi-1.7/arguments.c:405:11:  [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 *attrs[3] = {"+", "*", 0};
data/ldapvi-1.7/arguments.c:576: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 ( !(s = fopen(filename, "r"))) syserr();
data/ldapvi-1.7/base64.c:61:11:  [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.
	unsigned char input[3];
data/ldapvi-1.7/base64.c:62:11:  [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.
	unsigned char output[4];
data/ldapvi-1.7/base64.c:115:11:  [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.
	unsigned char input[3];
data/ldapvi-1.7/base64.c:116:11:  [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.
	unsigned char output[4];
data/ldapvi-1.7/data.c:174: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(str, av->data, n);
data/ldapvi-1.7/data.c:187: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(bv->bv_val, data, len);
data/ldapvi-1.7/diff.c:318:31:  [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).
	g_array_index(offsets, long, atoi(key)) = ftell(s);
data/ldapvi-1.7/error.c:38: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[32];
data/ldapvi-1.7/ldapvi.c:41:17:  [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 ( !(clean = fopen(cleanname, "r+"))) syserr();
data/ldapvi-1.7/ldapvi.c:42:16:  [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 ( !(data = fopen(dataname, "r"))) syserr();
data/ldapvi-1.7/ldapvi.c:714: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(url, "ldap://");
data/ldapvi-1.7/ldapvi.c:768: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).
	if ( (fd = open(name->str, O_WRONLY | O_CREAT | O_EXCL, 0600)) == -1) {
data/ldapvi-1.7/ldapvi.c:803: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 ( !(s = fopen(name, "w"))) syserr();
data/ldapvi-1.7/ldapvi.c:825: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 ( !(s = fopen(name, "w"))) syserr();
data/ldapvi-1.7/ldapvi.c:961:6:  [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).
	if (open("/dev/tty", O_RDWR) != fd)
data/ldapvi-1.7/ldapvi.c:1006: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 ( !(s = fopen(dataname, "r"))) syserr();
data/ldapvi-1.7/ldapvi.c:1014:33:  [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).
			g_array_index(offsets, long, atoi(key)) = -1;
data/ldapvi-1.7/ldapvi.c:1104:14:  [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 ( !(in = fopen(dataname, "r"))) syserr();
data/ldapvi-1.7/ldapvi.c:1105:15:  [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 ( !(out = fopen(tmpname, "w"))) syserr();
data/ldapvi-1.7/ldapvi.c:1160: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 ( !(s = fopen(file, "r"))) syserr();
data/ldapvi-1.7/ldapvi.c:1438:14:  [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 ( !(in = fopen(dataname, "r"))) syserr();
data/ldapvi-1.7/ldapvi.c:1439:15:  [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 ( !(out = fopen(tmpname, "w"))) syserr();
data/ldapvi-1.7/ldapvi.c:1469:14:  [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 ( !(in = fopen(sasl, "r"))) syserr();
data/ldapvi-1.7/ldapvi.c:1516: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 ( !(s = fopen(data, "w"))) syserr();
data/ldapvi-1.7/ldapvi.c:1526:20:  [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 ( !(source = fopen(cmdline->in_file, "r+")))
data/ldapvi-1.7/ldapvi.c:1533:18:  [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 ( !(tmp = fopen(clean, "w+"))) syserr();
data/ldapvi-1.7/ldapvi.c:1719:10:  [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 *) argv[2],
data/ldapvi-1.7/ldapvi.c:1720:10:  [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 *) argv[3]);
data/ldapvi-1.7/ldapvi.c:1795:16:  [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 *tmp = fopen(data, "r");
data/ldapvi-1.7/misc.c:49: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[4096];
data/ldapvi-1.7/misc.c:63:16:  [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).
	if ( (fdsrc = open(src, O_RDONLY)) == -1) syserr();
data/ldapvi-1.7/misc.c:65:16:  [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).
	if ( (fddst = open(dst, flags, 0600)) == -1) syserr();
data/ldapvi-1.7/misc.c:75: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[4096];
data/ldapvi-1.7/misc.c:137: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 ( !(f = fopen(pathname, "r+"))) syserr();
data/ldapvi-1.7/misc.c:175: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 buf[20];
data/ldapvi-1.7/misc.c:659: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(str + max, ": ");
data/ldapvi-1.7/parse.c:106: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).
	if ( (fd = open(name, O_RDONLY)) == -1) {
data/ldapvi-1.7/parse.c:146:11:  [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.
	unsigned char salt[2];
data/ldapvi-1.7/parse.c:147:11:  [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("/dev/random", 2);
data/ldapvi-1.7/parse.c:163:11:  [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.
	unsigned char salt[11];
data/ldapvi-1.7/parse.c:165:11:  [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("/dev/random", 2);
data/ldapvi-1.7/parseldif.c:135: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).
	if ( (fd = open(name, O_RDONLY)) == -1) {
data/ldapvi-1.7/port.c:60: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("/dev/random", O_RDONLY);
data/ldapvi-1.7/port.c:114:11:  [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.
	unsigned char tmp[SHA_DIGEST_LENGTH];
data/ldapvi-1.7/port.c:128: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 rand[4];
data/ldapvi-1.7/port.c:129:11:  [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.
	unsigned char tmp[SHA_DIGEST_LENGTH + sizeof(rand)];
data/ldapvi-1.7/port.c:139: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(tmp + SHA_DIGEST_LENGTH, rand, sizeof(rand));
data/ldapvi-1.7/port.c:152:11:  [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.
	unsigned char tmp[MD5_DIGEST_LENGTH];
data/ldapvi-1.7/port.c:166:11:  [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.
	unsigned char rand[4];
data/ldapvi-1.7/port.c:167:11:  [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.
	unsigned char tmp[MD5_DIGEST_LENGTH + sizeof(rand)];
data/ldapvi-1.7/port.c:177: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(tmp + MD5_DIGEST_LENGTH, rand, sizeof(rand));
data/ldapvi-1.7/sasl.c:53:11:  [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(pathname, O_RDWR | O_CREAT | O_TRUNC, 0600);
data/ldapvi-1.7/sasl.c:193:18:  [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 = (char *) interact[i].result;
data/ldapvi-1.7/sasl.c:194:19:  [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 *prompt = (char *) interact[i].prompt;
data/ldapvi-1.7/sasl.c:201:10:  [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 *) interact[i].challenge);
data/ldapvi-1.7/schema.c:144: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 *attrs[2] = {"subschemaSubentry", 0};
data/ldapvi-1.7/schema.c:290: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(name, ad, n);
data/ldapvi-1.7/search.c:266: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 *attrs[3] = {"+", "*", 0};
data/ldapvi-1.7/arguments.c:186: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).
		write(fd, USAGE, strlen(USAGE));
data/ldapvi-1.7/diff.c:217: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).
        bv.bv_len = strlen(str);
data/ldapvi-1.7/ldapvi.c:119:39:  [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).
	GString *newsup = g_string_sized_new(strlen(new));
data/ldapvi-1.7/ldapvi.c:713:22:  [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 *url = xalloc(strlen(server) + sizeof("ldap://"));
data/ldapvi-1.7/ldapvi.c:765: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).
	name->len = strlen(name->str);
data/ldapvi-1.7/misc.c:52:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ( (n = read(fdsrc, buf, sizeof(buf))) == -1) syserr();
data/ldapvi-1.7/misc.c:116:27:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (strchr(charbag, c = getchar()))
data/ldapvi-1.7/misc.c:283: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).
	n = strlen(home);
data/ldapvi-1.7/misc.c:284:26:  [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).
	result = xalloc(n + 1 + strlen(name) + 1);
data/ldapvi-1.7/misc.c:353:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(backup, rl_line_buffer, rl_end);
data/ldapvi-1.7/misc.c:357:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(rl_line_buffer, backup, rl_end);
data/ldapvi-1.7/misc.c:392: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).
	int k = strlen(a);
data/ldapvi-1.7/misc.c:393:28:  [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 *result = xalloc(k + strlen(b) + 1);
data/ldapvi-1.7/misc.c:650: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).
		max = MAX(max, strlen(d[i].prompt));
data/ldapvi-1.7/misc.c:655: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(prompt);
data/ldapvi-1.7/parse.c:70:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ( (c = fgetc(s)) == EOF) goto error;
data/ldapvi-1.7/parse.c:90:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ( (c = fgetc(s)) == ' ') /* folded line */ break;
data/ldapvi-1.7/parse.c:115:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ( (n = read(fd, data->str + olen, n)) == -1) syserr();
data/ldapvi-1.7/parse.c:128:16:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		switch ( c = fgetc(s)) {
data/ldapvi-1.7/parse.c:133:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ( (c = fgetc(s)) == ' ') /* folded line */ break;
data/ldapvi-1.7/parse.c:152:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(fd, salt, 2) != 2) syserr();
data/ldapvi-1.7/parse.c:173:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(fd, salt + 3, 8) != 8) syserr();
data/ldapvi-1.7/parse.c:178:17:  [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 (!result || strlen(result) < 25) {
data/ldapvi-1.7/parse.c:206:7:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = fgetc(s);
data/ldapvi-1.7/parseldif.c:51:8:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (fgetc(s) != '\n')
data/ldapvi-1.7/parseldif.c:56:15:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				if ( (c = fgetc(s)) == ' ')
data/ldapvi-1.7/parseldif.c:90:8:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (fgetc(s) != '\n')
data/ldapvi-1.7/parseldif.c:94:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ( (c = fgetc(s)) == ' ') /* folded line */ break;
data/ldapvi-1.7/parseldif.c:115:8:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (fgetc(s) != '\n')
data/ldapvi-1.7/parseldif.c:119:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ( (c = fgetc(s)) == ' ') /* folded line */ break;
data/ldapvi-1.7/parseldif.c:144:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ( (n = read(fd, data->str + olen, n)) == -1) syserr();
data/ldapvi-1.7/parseldif.c:157:16:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		switch ( c = fgetc(s)) {
data/ldapvi-1.7/parseldif.c:162:8:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (fgetc(s) != '\n')
data/ldapvi-1.7/parseldif.c:166:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ( (c = fgetc(s)) == ' ') /* folded line */ break;
data/ldapvi-1.7/parseldif.c:194:7:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = fgetc(s);
data/ldapvi-1.7/parseldif.c:202:8:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (fgetc(s) != '\n')
data/ldapvi-1.7/parseldif.c:313: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).
		dn = xalloc(i + strlen(komma) + 1);
data/ldapvi-1.7/port.c:53: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).
	int l = strlen(template);
data/ldapvi-1.7/port.c:66:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ( (n = read(fd, template + i, l - i)) == -1) {
data/ldapvi-1.7/port.c:115:30:  [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).
	SHA1((unsigned char *) key, strlen(key), tmp);
data/ldapvi-1.7/port.c:135: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).
	SHA1_Update(&SHA1context, key, strlen(key));
data/ldapvi-1.7/port.c:153: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).
	MD5((unsigned char *) key, strlen(key), tmp);
data/ldapvi-1.7/port.c:173:31:  [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).
	MD5_Update(&MD5context, key, strlen(key));
data/ldapvi-1.7/print.c:229: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).
	print_attrval(s, mod->mod_type, strlen(mod->mod_type), 0);
data/ldapvi-1.7/print.c:243: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).
	print_attrval(s, dn, strlen(dn), 1);
data/ldapvi-1.7/print.c:255:26:  [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).
	print_attrval(s, olddn, strlen(olddn), 1);
data/ldapvi-1.7/print.c:257:26:  [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).
	print_attrval(s, newdn, strlen(newdn), 0);
data/ldapvi-1.7/print.c:285:26:  [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).
	print_attrval(s, olddn, strlen(olddn), 1);
data/ldapvi-1.7/print.c:305: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).
	print_attrval(s, dn, strlen(dn), 1);
data/ldapvi-1.7/print.c:325: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).
	print_attrval(s, dn, strlen(dn), 1);
data/ldapvi-1.7/print.c:334: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(str);
data/ldapvi-1.7/print.c:452: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).
	print_attrval(s, dn, strlen(dn), 1);
data/ldapvi-1.7/sasl.c:115: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).
		interact->len = strlen(result);
data/ldapvi-1.7/sasl.c:223: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).
		interact[i].len = strlen(value);
data/ldapvi-1.7/search.c:54: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).
		if (strlen(dn) < cols - 28)

ANALYSIS SUMMARY:

Hits = 137
Lines analyzed = 8060 in approximately 0.58 seconds (13831 lines/second)
Physical Source Lines of Code (SLOC) = 6529
Hits@level = [0]  74 [1]  55 [2]  60 [3]   5 [4]  17 [5]   0
Hits@level+ = [0+] 211 [1+] 137 [2+]  82 [3+]  22 [4+]  17 [5+]   0
Hits/KSLOC@level+ = [0+] 32.3174 [1+] 20.9833 [2+] 12.5594 [3+] 3.36958 [4+] 2.60377 [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.