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/cvm-0.97/v2client.h
Examining data/cvm-0.97/module_request.c
Examining data/cvm-0.97/cvm-pgsql-udp.c
Examining data/cvm-0.97/sasl_plain.c
Examining data/cvm-0.97/module_output.c
Examining data/cvm-0.97/client_xfer_command.c
Examining data/cvm-0.97/v2client_wrappers.c
Examining data/cvm-0.97/sasl-auth-test.c
Examining data/cvm-0.97/sasl_authenticate.c
Examining data/cvm-0.97/cvm-mysql-udp.c
Examining data/cvm-0.97/sasl_auth.c
Examining data/cvm-0.97/cvm-pwfile.c
Examining data/cvm-0.97/sasl_cram_md5.c
Examining data/cvm-0.97/cvm-vchkpw.c
Examining data/cvm-0.97/random.h
Examining data/cvm-0.97/v2client.c
Examining data/cvm-0.97/sql.h
Examining data/cvm-0.97/getpwnam.c
Examining data/cvm-0.97/cvm-vmailmgr-local.c
Examining data/cvm-0.97/facts.c
Examining data/cvm-0.97/cvm-testclient.c
Examining data/cvm-0.97/client_setugid.c
Examining data/cvm-0.97/v1client.c
Examining data/cvm-0.97/cvm-benchclient.c
Examining data/cvm-0.97/client_setenv.c
Examining data/cvm-0.97/qmail-domains.c
Examining data/cvm-0.97/qmail-init.c
Examining data/cvm-0.97/module_local.c
Examining data/cvm-0.97/random.c
Examining data/cvm-0.97/client_xfer_compat.c
Examining data/cvm-0.97/sasl_start.c
Examining data/cvm-0.97/vmautoconvert.c
Examining data/cvm-0.97/cvm-v1testclient.c
Examining data/cvm-0.97/qmail-users.c
Examining data/cvm-0.97/sql-auth.c
Examining data/cvm-0.97/cvm-chain.c
Examining data/cvm-0.97/sasl_login.c
Examining data/cvm-0.97/module_local_main.c
Examining data/cvm-0.97/client_xfer_local.c
Examining data/cvm-0.97/errors.h
Examining data/cvm-0.97/vmlookup.c
Examining data/cvm-0.97/qmail-dotfile.c
Examining data/cvm-0.97/cvm-v1benchclient.c
Examining data/cvm-0.97/module.h
Examining data/cvm-0.97/qmail.h
Examining data/cvm-0.97/module_udp.c
Examining data/cvm-0.97/facts.h
Examining data/cvm-0.97/cvm-mysql.c
Examining data/cvm-0.97/qmail-lookup.c
Examining data/cvm-0.97/module_log.c
Examining data/cvm-0.97/sasl.h
Examining data/cvm-0.97/cvm-qmail.c
Examining data/cvm-0.97/cvm-unix.c
Examining data/cvm-0.97/cvm-mysql-local.c
Examining data/cvm-0.97/client_xfer_udp.c
Examining data/cvm-0.97/cvm-pgsql.c
Examining data/cvm-0.97/protocol.h
Examining data/cvm-0.97/module_command.c
Examining data/cvm-0.97/module_main.c
Examining data/cvm-0.97/sql-query-test.c
Examining data/cvm-0.97/v1client.h
Examining data/cvm-0.97/client_domain.c
Examining data/cvm-0.97/cvm-pgsql-local.c
Examining data/cvm-0.97/cvm-v1checkpassword.c
Examining data/cvm-0.97/sql-query.c
Examining data/cvm-0.97/module_command_main.c
Examining data/cvm-0.97/cvm-vmailmgr.h
Examining data/cvm-0.97/module_udp_main.c
Examining data/cvm-0.97/cvm-sqlite.c
Examining data/cvm-0.97/cvm-checkpassword.c
Examining data/cvm-0.97/errors.c
Examining data/cvm-0.97/cvm-vmailmgr.c
Examining data/cvm-0.97/cvm-vmailmgr-udp.c
Examining data/cvm-0.97/sasl_init.c
Examining data/cvm-0.97/sasl_internal.h
Examining data/cvm-0.97/credentials.h

FINAL RESULTS:

data/cvm-0.97/module_local.c:153:12:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
  else if (chmod(path, mode) == -1)
data/cvm-0.97/module_local.c:155:12:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
  else if (chown(path, owner, group) == -1)
data/cvm-0.97/client_domain.c:36: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(var, proto);
data/cvm-0.97/client_xfer_command.c:52:5:  [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(cmd, cmd, NULL);
data/cvm-0.97/cvm-checkpassword.c:70:3:  [4] (shell) execvp:
  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.
  execvp(argv[2], argv+2);
data/cvm-0.97/cvm-unix.c:31:14:  [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.
extern char* crypt(const char* key, const char* salt);
data/cvm-0.97/cvm-unix.c:55:14:  [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.
  if (strcmp(crypt(cvm_module_credentials[CVM_CRED_PASSWORD].s, pw->pw_passwd),
data/cvm-0.97/cvm-v1checkpassword.c:68:3:  [4] (shell) execvp:
  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.
  execvp(argv[2], argv+2);
data/cvm-0.97/cvm-vmailmgr.c:42:14:  [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.
extern char* crypt(const char* key, const char* salt);
data/cvm-0.97/cvm-vmailmgr.c:139:13:  [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.
      enc = crypt(pass, stored);
data/cvm-0.97/cvm-vmailmgr.c:143: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.
    enc = crypt(pass, stored);
data/cvm-0.97/client_domain.c:29: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 ((proto = getenv("PROTO")) == 0) proto = "TCP";
data/cvm-0.97/client_domain.c:38:10:  [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.
  return getenv(var);
data/cvm-0.97/cvm-chain.c:39:32:  [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 ((chains[chain_count] = getenv(varname)) != 0)
data/cvm-0.97/cvm-mysql.c:52:10:  [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.
  host = getenv("CVM_MYSQL_HOST");
data/cvm-0.97/cvm-mysql.c:53:10:  [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.
  user = getenv("CVM_MYSQL_USER");
data/cvm-0.97/cvm-mysql.c:54:10:  [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.
  pass = getenv("CVM_MYSQL_PASS");
data/cvm-0.97/cvm-mysql.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.
  db = getenv("CVM_MYSQL_DB");
data/cvm-0.97/cvm-mysql.c:56:9:  [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.
  tmp = getenv("CVM_MYSQL_PORT");
data/cvm-0.97/cvm-mysql.c:58:17:  [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.
  unix_socket = getenv("CVM_MYSQL_SOCKET");
data/cvm-0.97/cvm-mysql.c:61:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((tmp = getenv("CVM_MYSQL_DEFAULT_FILE")) != 0)
data/cvm-0.97/cvm-mysql.c:64:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((tmp = getenv("CVM_MYSQL_DEFAULT_GROUP")) != 0)
data/cvm-0.97/cvm-pwfile.c:36:21:  [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 ((pwfilename = getenv("CVM_PWFILE_PATH")) == 0) return CVME_CONFIG;
data/cvm-0.97/cvm-pwfile.c:37:20:  [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 (!pwcmp_start(getenv("CVM_PWFILE_PWCMP"))) return CVME_GENERAL;
data/cvm-0.97/cvm-qmail.c:47:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((tmp = getenv("CVM_QMAIL_LOOKASIDE")) != 0) {
data/cvm-0.97/cvm-qmail.c:53:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((tmp = getenv("CVM_QMAIL_CHECK_PERMS")) != 0 && tmp[0] != 0) {
data/cvm-0.97/cvm-sqlite.c:82:12:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  dbfile = getenv("CVM_SQLITE_DB");
data/cvm-0.97/cvm-vmailmgr.c:84:17:  [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 ((pwfile = getenv("VMAILMGR_PWFILE")) == 0) pwfile = "passwd.cdb";
data/cvm-0.97/cvm-vmailmgr.c:85:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((tmp = getenv("VMAILMGR_DEFAULT")) == 0) tmp = "+";
data/cvm-0.97/cvm-vmailmgr.c:86:19:  [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.
  lock_disabled = getenv("VMAILMGR_LOCK_DISABLED") != 0;
data/cvm-0.97/cvm-vmailmgr.c:87:20:  [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.
  do_autoconvert = getenv("VMAILMGR_AUTOCONVERT") != 0;
data/cvm-0.97/cvm-vmailmgr.c:89: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("DEBUG") != 0) show_debug = 1;
data/cvm-0.97/module_local.c:124:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((tmp = getenv("CVM_SOCKET_MODE")) != 0)
data/cvm-0.97/module_local.c:126:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((tmp = getenv("CVM_SOCKET_OWNER")) != 0) {
data/cvm-0.97/module_local.c:137:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((tmp = getenv("CVM_SOCKET_GROUP")) != 0) {
data/cvm-0.97/module_local.c:179:12:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((e = getenv("CVM_LOCAL_TIMEOUT")) == 0
data/cvm-0.97/module_request.c:37:30:  [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.
  cvm_module_lookup_secret = getenv("CVM_LOOKUP_SECRET");
data/cvm-0.97/qmail-domains.c:110:18:  [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.
  assume_local = getenv("CVM_QMAIL_ASSUME_LOCAL") != 0;
data/cvm-0.97/qmail-init.c:64:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if ((tmp = getenv("QMAIL_ROOT")) != 0)
data/cvm-0.97/qmail-lookup.c:34:24:  [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 ((missingdomain = getenv("CVM_QMAIL_MISSINGDOMAIN")) != 0)
data/cvm-0.97/qmail-lookup.c:37:22:  [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 ((missinguser = getenv("CVM_QMAIL_MISSINGUSER")) == 0
data/cvm-0.97/sasl_init.c:34:16:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if ((tmp = getenv(mech->var)) != 0)
data/cvm-0.97/sasl_init.c:38: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.
  if (!mechanisms[0].cvm && (tmp = getenv("CVM_SASL_LOGIN")) != 0) {
data/cvm-0.97/sql-auth.c:32: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 ((query = getenv(sql_query_var)) == 0) return CVME_CONFIG;
data/cvm-0.97/sql-auth.c:35: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 ((postq = getenv(sql_postq_var)) != 0)
data/cvm-0.97/sql-auth.c:40:20:  [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 (!pwcmp_start(getenv(sql_pwcmp_var))) return CVME_GENERAL;
data/cvm-0.97/sql-query.c:102: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.
	ptr = getenv(name.s);
data/cvm-0.97/v1client.c:87: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.
    if ((sc = getenv("CVM_ACCOUNT_SPLIT_CHARS")) == 0)
data/cvm-0.97/v2client.c:112: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 ((e = getenv("CVM_RANDOM_BYTES")) != 0)
data/cvm-0.97/v2client.c:151:17:  [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("CVM_LOOKUP_SECRET")) != 0)
data/cvm-0.97/v2client.c:211:13:  [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 ((sc = getenv("CVM_ACCOUNT_SPLIT_CHARS")) == 0)
data/cvm-0.97/client_domain.c:37:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
  strcat(var, "LOCALHOST");
data/cvm-0.97/client_setenv.c:34: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 utoa_buf[32];
data/cvm-0.97/client_xfer_compat.c:31:13:  [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 buffer[CVM_BUFSIZE],
data/cvm-0.97/client_xfer_compat.c:41: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(request.data, buffer, sizeof buffer);
data/cvm-0.97/client_xfer_compat.c:44: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(buffer, response.data, sizeof buffer);
data/cvm-0.97/client_xfer_compat.c:51:15:  [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 buffer[CVM_BUFSIZE],
data/cvm-0.97/client_xfer_compat.c:58:13:  [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 buffer[CVM_BUFSIZE],
data/cvm-0.97/client_xfer_compat.c:65: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.
		      unsigned char buffer[CVM_BUFSIZE],
data/cvm-0.97/client_xfer_udp.c:69: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(hostname, hostport, portstr-hostport);
data/cvm-0.97/client_xfer_udp.c:74: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(&ip, he->h_addr_list[0], 4);
data/cvm-0.97/cvm-benchclient.c:36: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 num[FMT_ULONG_LEN];
data/cvm-0.97/cvm-checkpassword.c:29: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 buffer[513];
data/cvm-0.97/cvm-mysql.c:57:16:  [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).
  port = tmp ? atoi(tmp) : 0;
data/cvm-0.97/cvm-testclient.c:49: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 num[FMT_ULONG_LEN];
data/cvm-0.97/cvm-v1benchclient.c:32: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 num[FMT_ULONG_LEN];
data/cvm-0.97/cvm-v1checkpassword.c:29: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 buffer[513];
data/cvm-0.97/cvm-v1testclient.c:46: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 num[FMT_ULONG_LEN];
data/cvm-0.97/cvm-vchkpw.c:74: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(mailbox, mypw->pw_dir, dirlen);
data/cvm-0.97/cvm-vchkpw.c:75: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(mailbox+dirlen, "/Maildir/", 10);
data/cvm-0.97/module.h:21: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.
extern unsigned char cvm_module_outbuffer[BUFSIZE];
data/cvm-0.97/module.h:23: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.
extern unsigned char cvm_module_inbuffer[BUFSIZE+1];
data/cvm-0.97/module_log.c:34: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 buf[BUFSIZE+4];
data/cvm-0.97/module_log.c:45: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(ptr,
data/cvm-0.97/module_log.c:52: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(ptr,
data/cvm-0.97/module_output.c:25: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.
unsigned char cvm_module_outbuffer[BUFSIZE];
data/cvm-0.97/module_output.c:38: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(outbufptr, data, len);
data/cvm-0.97/module_output.c:54: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(outbufptr, data, len);
data/cvm-0.97/module_output.c:101: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 buf[64];
data/cvm-0.97/module_request.c:26: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.
unsigned char cvm_module_inbuffer[BUFSIZE+1];
data/cvm-0.97/module_udp.c:65: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(&ip, he->h_addr_list[0], 4);
data/cvm-0.97/qmail-init.c:35: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 buf[4096];
data/cvm-0.97/qmail-init.c:43: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(path->s, O_RDONLY)) == -1)
data/cvm-0.97/qmail-init.c:54: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(news, buf, len);
data/cvm-0.97/qmail-users.c:54:23:  [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 ((users_fd = open(users_path.s, O_RDONLY)) != -1) {
data/cvm-0.97/sasl_cram_md5.c:9:23:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const unsigned char hex2bin[256] = {
data/cvm-0.97/sasl_cram_md5.c:31: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 binresp[16];
data/cvm-0.97/v1client.c:68: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(ptr, str, len);
data/cvm-0.97/v1client.h:12:12:  [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 data[CVM_BUFSIZE];
data/cvm-0.97/v1client.h:38:15:  [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 buffer[CVM_BUFSIZE],
data/cvm-0.97/v1client.h:41:20:  [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 buffer[CVM_BUFSIZE],
data/cvm-0.97/v1client.h:44: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.
			     unsigned char buffer[CVM_BUFSIZE],
data/cvm-0.97/v2client.c:97: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(ptr, data, len);
data/cvm-0.97/v2client.c:113:6:  [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).
	i = atoi(e);
data/cvm-0.97/v2client.h:20:12:  [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 data[CVM_BUFSIZE];
data/cvm-0.97/v2client.h:47:15:  [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 buffer[CVM_BUFSIZE],
data/cvm-0.97/v2client.h:50:20:  [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 buffer[CVM_BUFSIZE],
data/cvm-0.97/v2client.h:53: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.
			     unsigned char buffer[CVM_BUFSIZE],
data/cvm-0.97/vmautoconvert.c:37:12:  [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 buf[2048];
data/cvm-0.97/vmautoconvert.c:46:12:  [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 buf[8];
data/cvm-0.97/vmlookup.c:93: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(pwfile, O_RDONLY)) == -1) {
data/cvm-0.97/client_domain.c:30:12:  [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).
  newlen = strlen(proto) + 9;
data/cvm-0.97/client_xfer_command.c:99:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    rd = read(fd, buffer, CVM_BUFSIZE-buflen);
data/cvm-0.97/client_xfer_local.c:47:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if ((io = read(sock, response->data+done, CVM_BUFSIZE-done)) == 0)
data/cvm-0.97/cvm-checkpassword.c:39:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      rd = read(3, buffer+buflen, sizeof buffer - buflen);
data/cvm-0.97/cvm-v1checkpassword.c:39:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      rd = read(3, buffer+buflen, sizeof buffer - buflen);
data/cvm-0.97/cvm-vchkpw.c:71: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).
  const long dirlen = strlen(mypw->pw_dir);
data/cvm-0.97/getpwnam.c:45: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).
  if ((len = strlen(account)) > actlen) {
data/cvm-0.97/module_command.c:29:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((rd = read(0, cvm_module_inbuffer+cvm_module_inbuflen,
data/cvm-0.97/module_local.c:76:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((rd = read(conn, cvm_module_inbuffer+cvm_module_inbuflen,
data/cvm-0.97/module_local.c:148:15:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
  old_umask = umask((mode & 0777) ^ 0777);
data/cvm-0.97/module_local.c:160:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(old_umask);
data/cvm-0.97/module_output.c:87: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).
  return fact(number, data, strlen(data));
data/cvm-0.97/qmail-init.c:45:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  rd = read(fd, buf, sizeof buf);
data/cvm-0.97/qmail-users.c:100: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).
  if ((ptr += strlen(ptr) + 1) >= end) return -1;
data/cvm-0.97/qmail-users.c:106: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).
  if ((ptr += strlen(ptr) + 1) >= end) return -1;
data/cvm-0.97/sql-query.c:104: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).
	  if (!str_catb_quoted(q, ptr, strlen(ptr)))
data/cvm-0.97/v1client.c:84:12:  [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).
  actlen = strlen(account);
data/cvm-0.97/v1client.c:89: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).
    i = strlen(account);
data/cvm-0.97/v1client.c:100: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).
  if (!packet_add(p, domain, strlen(domain))) return 0;
data/cvm-0.97/v1client.c:103:40:  [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 (!packet_add(p, credentials[i], strlen(credentials[i])))
data/cvm-0.97/v1client.c:121:12:  [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).
    ptr += strlen((char*)ptr) + 1;
data/cvm-0.97/v2client.c:152:41:  [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 (!packet_add(p, CVM_CRED_SECRET, strlen(env), env))

ANALYSIS SUMMARY:

Hits = 123
Lines analyzed = 5601 in approximately 0.20 seconds (27809 lines/second)
Physical Source Lines of Code (SLOC) = 4065
Hits@level = [0]   0 [1]  22 [2]  50 [3]  40 [4]   9 [5]   2
Hits@level+ = [0+] 123 [1+] 123 [2+] 101 [3+]  51 [4+]  11 [5+]   2
Hits/KSLOC@level+ = [0+] 30.2583 [1+] 30.2583 [2+] 24.8462 [3+] 12.5461 [4+] 2.70603 [5+] 0.492005
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.