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/cifs-utils-6.11/cifs_spnego.h
Examining data/cifs-utils-6.11/mtab.c
Examining data/cifs-utils-6.11/idmap_plugin.c
Examining data/cifs-utils-6.11/cifsidmap.h
Examining data/cifs-utils-6.11/data_blob.c
Examining data/cifs-utils-6.11/cifs.idmap.c
Examining data/cifs-utils-6.11/pam_cifscreds.c
Examining data/cifs-utils-6.11/asn1.h
Examining data/cifs-utils-6.11/asn1.c
Examining data/cifs-utils-6.11/spnego.c
Examining data/cifs-utils-6.11/resolve_host.h
Examining data/cifs-utils-6.11/spnego.h
Examining data/cifs-utils-6.11/getcifsacl.c
Examining data/cifs-utils-6.11/mount.h
Examining data/cifs-utils-6.11/cifsacl.h
Examining data/cifs-utils-6.11/smbinfo.c
Examining data/cifs-utils-6.11/util.c
Examining data/cifs-utils-6.11/cifscreds.c
Examining data/cifs-utils-6.11/idmapwb.c
Examining data/cifs-utils-6.11/cifs.upcall.c
Examining data/cifs-utils-6.11/cifskey.h
Examining data/cifs-utils-6.11/setcifsacl.c
Examining data/cifs-utils-6.11/data_blob.h
Examining data/cifs-utils-6.11/cifskey.c
Examining data/cifs-utils-6.11/idmap_plugin.h
Examining data/cifs-utils-6.11/resolve_host.c
Examining data/cifs-utils-6.11/mount.cifs.c
Examining data/cifs-utils-6.11/util.h

FINAL RESULTS:

data/cifs-utils-6.11/cifs.upcall.c:278:8:  [4] (format) snprintf:
  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 = snprintf(pathname, ENV_PATH_MAXLEN, ENV_PATH_FMT, pid);
data/cifs-utils-6.11/cifscreds.c:213:9:  [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.
	pass = getpass("Password: ");
data/cifs-utils-6.11/cifscreds.c:419:9:  [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.
	pass = getpass("Password: ");
data/cifs-utils-6.11/mount.cifs.c:565:6:  [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.
	i = access(file_name, R_OK);
data/cifs-utils-6.11/mount.cifs.c:649: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.
		rc = access(filename, R_OK);
data/cifs-utils-6.11/mount.cifs.c:906:5:  [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(parsed_info->addrlist, value);
data/cifs-utils-6.11/mount.cifs.c:1595:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	if (sprintf(mtabtmpfile, "%s%s", mtabdir, MNT_TMP_FILE) != len) {
data/cifs-utils-6.11/mount.cifs.c:1609:16:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
	mtabtmpfile = mktemp(mtabtmpfile);
data/cifs-utils-6.11/mount.cifs.c:1721:7:  [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.
		if (execlp("systemd-ask-password", "systemd-ask-password", prompt, NULL) == -1) {
data/cifs-utils-6.11/mount.cifs.c:1799:19:  [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.
	char *tmp_pass = getpass(prompt);
data/cifs-utils-6.11/mtab.c:175:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(linktargetfile, MOUNTLOCK_LINKTARGET, getpid ());
data/cifs-utils-6.11/smbinfo.c:771: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("S-1-%" PRIu64, idauth);
data/cifs-utils-6.11/smbinfo.c:1017: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("-%" PRIu64, u64);
data/cifs-utils-6.11/cifs.idmap.c:241:14:  [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.
	while ((c = getopt_long(argc, argv, "ht:v",
data/cifs-utils-6.11/cifs.upcall.c:947:14:  [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.
	while ((c = getopt_long(argc, argv, "cEk:K:ltve:", long_options, NULL)) != -1) {
data/cifs-utils-6.11/cifscreds.c:477:13:  [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.
	while((n = getopt_long(argc, argv, "du:", longopts, NULL)) != -1) {
data/cifs-utils-6.11/getcifsacl.c:410:14:  [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.
	while ((c = getopt_long(argc, argv, "Rrhv", NULL, NULL)) != -1) {
data/cifs-utils-6.11/mount.cifs.c:1354:6:  [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 (getenv("PASSWD"))
data/cifs-utils-6.11/mount.cifs.c:1355:34:  [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.
		rc = set_password(parsed_info, getenv("PASSWD"));
data/cifs-utils-6.11/mount.cifs.c:1356: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.
	else if (getenv("PASSWD_FD"))
data/cifs-utils-6.11/mount.cifs.c:1357:36:  [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.
		rc = get_password_from_file(atoi(getenv("PASSWD_FD")), NULL,
data/cifs-utils-6.11/mount.cifs.c:1359: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.
	else if (getenv("PASSWD_FILE"))
data/cifs-utils-6.11/mount.cifs.c:1360:34:  [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.
		rc = get_password_from_file(0, getenv("PASSWD_FILE"),
data/cifs-utils-6.11/mount.cifs.c:1885: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.
		if (getenv("USER"))
data/cifs-utils-6.11/mount.cifs.c:1886:35:  [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.
			strlcpy(parsed_info->username, getenv("USER"),
data/cifs-utils-6.11/mount.cifs.c:1983:15:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	mountpoint = realpath(".", NULL);
data/cifs-utils-6.11/mount.cifs.c:2060:14:  [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.
	while ((c = getopt_long(argc, argv, "?fhno:rsvVw",
data/cifs-utils-6.11/setcifsacl.c:840:6:  [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.
	c = getopt(argc, argv, "hvD:M:a:S:");
data/cifs-utils-6.11/smbinfo.c:1228:14:  [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.
	while ((c = getopt_long(argc, argv, "c:vVh", NULL, NULL)) != -1) {
data/cifs-utils-6.11/asn1.c:56: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(data->data + data->ofs, p, len);
data/cifs-utils-6.11/cifs.upcall.c:268: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 pathname[ENV_PATH_MAXLEN];
data/cifs-utils-6.11/cifs.upcall.c:285: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(pathname, O_RDONLY);
data/cifs-utils-6.11/cifs.upcall.c:460: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.
	static char gss_cksum[24] = { 0x10, 0x00, /* ... */};
data/cifs-utils-6.11/cifs.upcall.c:788: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 ip[INET6_ADDRSTRLEN];
data/cifs-utils-6.11/cifs.upcall.c:864: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 converted[INET6_ADDRSTRLEN + 1];
data/cifs-utils-6.11/cifs.upcall.c:931: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 hostbuf[NI_MAXHOST], *host;
data/cifs-utils-6.11/cifs.upcall.c:1168: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 fqdn[NI_MAXHOST];
data/cifs-utils-6.11/cifs.upcall.c:1239: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(&(keydata->data), sess_key.data, sess_key.length);
data/cifs-utils-6.11/cifs.upcall.c:1240: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(&(keydata->data) + keydata->sesskey_len,
data/cifs-utils-6.11/cifscreds.c:50: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	name[MAX_COMMAND_SIZE];
data/cifs-utils-6.11/cifscreds.c:146: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 addrstr[MAX_ADDR_LIST_LEN];
data/cifs-utils-6.11/cifscreds.c:252: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 addrstr[MAX_ADDR_LIST_LEN];
data/cifs-utils-6.11/cifscreds.c:360: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 addrstr[MAX_ADDR_LIST_LEN];
data/cifs-utils-6.11/cifscreds.c:362: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 *addrs[16];
data/cifs-utils-6.11/cifscreds.c:470:17:  [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.
	thisprogram = (char *)basename(argv[0]);
data/cifs-utils-6.11/cifskey.c:31: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 desc[INET6_ADDRSTRLEN + sizeof(KEY_PREFIX) + 4];
data/cifs-utils-6.11/cifskey.c:46: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 desc[INET6_ADDRSTRLEN + sizeof(KEY_PREFIX) + 4];
data/cifs-utils-6.11/cifskey.c:47: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 val[MOUNT_PASSWD_SIZE +  MAX_USERNAME_SIZE + 2];
data/cifs-utils-6.11/mount.cifs.c:177: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 host[NI_MAXHOST + 1];
data/cifs-utils-6.11/mount.cifs.c:178: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 share[MAX_SHARE_LEN + 1];
data/cifs-utils-6.11/mount.cifs.c:179: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 prefix[PATH_MAX + 1];
data/cifs-utils-6.11/mount.cifs.c:180: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 options[MAX_OPTIONS_LEN];
data/cifs-utils-6.11/mount.cifs.c:181: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 domain[MAX_DOMAIN_SIZE + 1];
data/cifs-utils-6.11/mount.cifs.c:182: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 username[MAX_USERNAME_SIZE + 1];
data/cifs-utils-6.11/mount.cifs.c:183: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 password[MOUNT_PASSWD_SIZE + 1];
data/cifs-utils-6.11/mount.cifs.c:184: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 addrlist[MAX_ADDR_LIST_LEN];
data/cifs-utils-6.11/mount.cifs.c:572:7:  [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).
	fs = fopen(file_name, "r");
data/cifs-utils-6.11/mount.cifs.c:642: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[sizeof(parsed_info->password) + 1];
data/cifs-utils-6.11/mount.cifs.c:658:19:  [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).
		file_descript = open(filename, O_RDONLY);
data/cifs-utils-6.11/mount.cifs.c:814: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 txtbuf[22];
data/cifs-utils-6.11/mount.cifs.c:1343: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(parsed_info->host, host, hostlen);
data/cifs-utils-6.11/mount.cifs.c:1344: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(parsed_info->share, share, sharelen);
data/cifs-utils-6.11/mount.cifs.c:1345: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(parsed_info->prefix, prepath, prepathlen);
data/cifs-utils-6.11/mount.cifs.c:1357: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).
		rc = get_password_from_file(atoi(getenv("PASSWD_FD")), NULL,
data/cifs-utils-6.11/mount.cifs.c:1895: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 tmp_pass[MOUNT_PASSWD_SIZE + 1];
data/cifs-utils-6.11/mtab.c:154: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 linktargetfile[MOUNTLOCK_LINKTARGET_LTH];
data/cifs-utils-6.11/mtab.c:177: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).
	i = open (linktargetfile, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR);
data/cifs-utils-6.11/mtab.c:210:17:  [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).
		lockfile_fd = open (_PATH_MOUNTED_LOCK, O_WRONLY);
data/cifs-utils-6.11/pam_cifscreds.c:162: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 addrstr[MAX_ADDR_LIST_LEN];
data/cifs-utils-6.11/pam_cifscreds.c:280: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 addrstr[MAX_ADDR_LIST_LEN];
data/cifs-utils-6.11/resolve_host.c:41: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 tmpbuf[NI_MAXHOST + 1 + 10 + 1];
data/cifs-utils-6.11/setcifsacl.c:406: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(facesptr[i], pace, sizeof(struct cifs_ace));
data/cifs-utils-6.11/smbinfo.c:212: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(&u32, &sd[0], 4);
data/cifs-utils-6.11/smbinfo.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(&u16, &sd[4], 2);
data/cifs-utils-6.11/smbinfo.c:218: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(&u16, &sd[6], 2);
data/cifs-utils-6.11/smbinfo.c:276: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(&u16, &sd[0], 2);
data/cifs-utils-6.11/smbinfo.c:329: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(&qi[1], &level, 2);
data/cifs-utils-6.11/smbinfo.c:344: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(&access_flags, &sd[0], 4);
data/cifs-utils-6.11/smbinfo.c:386: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(&mask, &sd[0], 4);
data/cifs-utils-6.11/smbinfo.c:461: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(&u64, &sd[0], 8);
data/cifs-utils-6.11/smbinfo.c:465: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(&u64, &sd[8], 8);
data/cifs-utils-6.11/smbinfo.c:469: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(&u64, &sd[16], 8);
data/cifs-utils-6.11/smbinfo.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(&u64, &sd[24], 8);
data/cifs-utils-6.11/smbinfo.c:477: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(&u32, &sd[32], 4);
data/cifs-utils-6.11/smbinfo.c:511: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(&u64, &sd[0], 8);
data/cifs-utils-6.11/smbinfo.c:514: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(&u64, &sd[8], 8);
data/cifs-utils-6.11/smbinfo.c:517: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(&u32, &sd[16], 4);
data/cifs-utils-6.11/smbinfo.c:550: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(&u64, &sd[0], 8);
data/cifs-utils-6.11/smbinfo.c:590: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(&u32, &sd[32], 4);
data/cifs-utils-6.11/smbinfo.c:623: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(&u64, &sd[0], 8);
data/cifs-utils-6.11/smbinfo.c:653: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(&u32, &sd[0], 4);
data/cifs-utils-6.11/smbinfo.c:684: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(&u64, &sd[0], 8);
data/cifs-utils-6.11/smbinfo.c:687: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(&u64, &sd[8], 8);
data/cifs-utils-6.11/smbinfo.c:691: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(&u64, &sd[16], 8);
data/cifs-utils-6.11/smbinfo.c:695: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(&u32, &sd[24], 4);
data/cifs-utils-6.11/smbinfo.c:698: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(&u32, &sd[28], 4);
data/cifs-utils-6.11/smbinfo.c:773: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(&subauth, &sd[8 + 4 * i], 4);
data/cifs-utils-6.11/smbinfo.c:824: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(&u32, &sd[0], 4);
data/cifs-utils-6.11/smbinfo.c:849: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(&size, &sd[2], 2);
data/cifs-utils-6.11/smbinfo.c:878: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(&count, &sd[4], 2);
data/cifs-utils-6.11/smbinfo.c:925: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(&u16, &sd[2], 2);
data/cifs-utils-6.11/smbinfo.c:928: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(&offset_owner, &sd[4], 4);
data/cifs-utils-6.11/smbinfo.c:930: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(&offset_group, &sd[8], 4);
data/cifs-utils-6.11/smbinfo.c:932: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(&offset_dacl, &sd[16], 4);
data/cifs-utils-6.11/smbinfo.c:984: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(&u32, &sd[off], 4);
data/cifs-utils-6.11/smbinfo.c:987: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(&u32, &sd[off + 4], 4);
data/cifs-utils-6.11/smbinfo.c:991: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(&u64, &sd[off + 8], 8);
data/cifs-utils-6.11/smbinfo.c:995: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(&u64, &sd[off + 16], 8);
data/cifs-utils-6.11/smbinfo.c:999: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(&u64, &sd[off + 24], 8);
data/cifs-utils-6.11/smbinfo.c:1006: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(&u64, &sd[off + 32], 8);
data/cifs-utils-6.11/smbinfo.c:1020: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(&u32, &sd[off + 48 + 4 * i], 4);
data/cifs-utils-6.11/smbinfo.c:1051: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(&buf[4], &i, 4);
data/cifs-utils-6.11/smbinfo.c:1069: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 snapshot_data[0];
data/cifs-utils-6.11/smbinfo.c:1081: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 gmt_token[GMT_NAME_LEN + 1] = {0};
data/cifs-utils-6.11/smbinfo.c:1250: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).
	if ((f = open(argv[optind + 1 ], O_RDONLY)) < 0) {
data/cifs-utils-6.11/util.c:43: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(d, s, len);
data/cifs-utils-6.11/util.c:67: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(d+len1, s, len2);
data/cifs-utils-6.11/asn1.c:158: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).
	*blob = data_blob_talloc(mem_ctx, NULL, strlen(OID));
data/cifs-utils-6.11/cifs.idmap.c:75: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).
	sublen = strlen(substr);
data/cifs-utils-6.11/cifs.upcall.c:219: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).
				 strlen(realm))
data/cifs-utils-6.11/cifs.upcall.c:303:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	buflen = read(fd, buf, bufsize);
data/cifs-utils-6.11/cifs.upcall.c:655: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).
				len = strlen(tkn);
data/cifs-utils-6.11/cifs.upcall.c:670: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).
				len = strlen(tkn);
data/cifs-utils-6.11/cifs.upcall.c:685: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).
				len = strlen(tkn);
data/cifs-utils-6.11/cifs.upcall.c:825: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).
	c = setup_key(key, ip, strlen(ip) + 1);
data/cifs-utils-6.11/cifs.upcall.c:866: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(ipaddr) > INET_ADDRSTRLEN) && !strchr(ipaddr, ':')) {
data/cifs-utils-6.11/cifs.upcall.c:1037: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(arg.hostname) >= NI_MAXHOST) {
data/cifs-utils-6.11/idmapwb.c:96: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(domain) + 1 + strlen(name) + 1;
data/cifs-utils-6.11/idmapwb.c:96: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).
	len = strlen(domain) + 1 + strlen(name) + 1;
data/cifs-utils-6.11/mount.cifs.c:675:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	rc = read(file_descript, buf, sizeof(buf) - 1);
data/cifs-utils-6.11/mount.cifs.c:1149: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).
			if ((strlen(value) != GMT_NAME_LEN) ||
data/cifs-utils-6.11/mount.cifs.c:1160: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).
		word_len = strlen(data);
data/cifs-utils-6.11/mount.cifs.c:1162: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).
			word_len += 1 + strlen(value);
data/cifs-utils-6.11/mount.cifs.c:1179: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).
		out_len = strlen(out);
data/cifs-utils-6.11/mount.cifs.c:1200: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).
		out_len = strlen(out);
data/cifs-utils-6.11/mount.cifs.c:1216: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).
		out_len = strlen(out);
data/cifs-utils-6.11/mount.cifs.c:1247: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).
		out_len = strlen(out);
data/cifs-utils-6.11/mount.cifs.c:1335: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).
	prepathlen = strlen(prepath);
data/cifs-utils-6.11/mount.cifs.c:1587: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(mtabdir) + strlen(MNT_TMP_FILE);
data/cifs-utils-6.11/mount.cifs.c:1587: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).
	len = strlen(mtabdir) + strlen(MNT_TMP_FILE);
data/cifs-utils-6.11/mount.cifs.c:1736:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		rc = read(fd[0], input + offs, capacity - offs);
data/cifs-utils-6.11/mount.cifs.c:1787: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(input);
data/cifs-utils-6.11/mount.cifs.c:1803:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(input, tmp_pass, capacity - 1);
data/cifs-utils-6.11/mount.cifs.c:1807: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).
	memset(tmp_pass, 0, strlen(tmp_pass));
data/cifs-utils-6.11/pam_cifscreds.c:78: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_t host_len = strlen("host=");
data/cifs-utils-6.11/pam_cifscreds.c:79: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).
	size_t domain_len = strlen("domain=");
data/cifs-utils-6.11/pam_cifscreds.c:129: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 (password);
data/cifs-utils-6.11/setcifsacl.c:428: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).
		if (!strlen(invaltype)) {
data/cifs-utils-6.11/setcifsacl.c:441: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(typestr);
data/cifs-utils-6.11/setcifsacl.c:496: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(invalflag)) {
data/cifs-utils-6.11/util.c:39: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(s);
data/cifs-utils-6.11/util.c:56: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).
	size_t len1 = strlen(d);
data/cifs-utils-6.11/util.c:57: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).
	size_t len2 = strlen(s);

ANALYSIS SUMMARY:

Hits = 153
Lines analyzed = 9800 in approximately 0.37 seconds (26350 lines/second)
Physical Source Lines of Code (SLOC) = 7131
Hits@level = [0] 566 [1]  36 [2]  88 [3]  16 [4]  13 [5]   0
Hits@level+ = [0+] 719 [1+] 153 [2+] 117 [3+]  29 [4+]  13 [5+]   0
Hits/KSLOC@level+ = [0+] 100.827 [1+] 21.4556 [2+] 16.4072 [3+] 4.06675 [4+] 1.82303 [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.