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/masqmail-0.3.4/acconfig.h
Examining data/masqmail-0.3.4/src/accept.c
Examining data/masqmail-0.3.4/src/address.c
Examining data/masqmail-0.3.4/src/alias.c
Examining data/masqmail-0.3.4/src/base64/base64.c
Examining data/masqmail-0.3.4/src/base64/base64.h
Examining data/masqmail-0.3.4/src/base64/base64dec.c
Examining data/masqmail-0.3.4/src/base64/base64enc.c
Examining data/masqmail-0.3.4/src/child.c
Examining data/masqmail-0.3.4/src/conf.c
Examining data/masqmail-0.3.4/src/connect.c
Examining data/masqmail-0.3.4/src/deliver.c
Examining data/masqmail-0.3.4/src/dotlock.c
Examining data/masqmail-0.3.4/src/dotlock.h
Examining data/masqmail-0.3.4/src/expand.c
Examining data/masqmail-0.3.4/src/fail_msg.c
Examining data/masqmail-0.3.4/src/header.c
Examining data/masqmail-0.3.4/src/interface.c
Examining data/masqmail-0.3.4/src/listen.c
Examining data/masqmail-0.3.4/src/local.c
Examining data/masqmail-0.3.4/src/log.c
Examining data/masqmail-0.3.4/src/lookup.c
Examining data/masqmail-0.3.4/src/lookup.h
Examining data/masqmail-0.3.4/src/masqmail.c
Examining data/masqmail-0.3.4/src/masqmail.h
Examining data/masqmail-0.3.4/src/md5/hmac_md5.c
Examining data/masqmail-0.3.4/src/md5/hmac_md5.h
Examining data/masqmail-0.3.4/src/md5/hmactest.c
Examining data/masqmail-0.3.4/src/md5/md5.c
Examining data/masqmail-0.3.4/src/md5/md5.h
Examining data/masqmail-0.3.4/src/message.c
Examining data/masqmail-0.3.4/src/mservdetect.c
Examining data/masqmail-0.3.4/src/online.c
Examining data/masqmail-0.3.4/src/parse.c
Examining data/masqmail-0.3.4/src/peopen.c
Examining data/masqmail-0.3.4/src/peopen.h
Examining data/masqmail-0.3.4/src/queue.c
Examining data/masqmail-0.3.4/src/readsock.c
Examining data/masqmail-0.3.4/src/readsock.h
Examining data/masqmail-0.3.4/src/readtest.c
Examining data/masqmail-0.3.4/src/resolvtest.c
Examining data/masqmail-0.3.4/src/rewrite.c
Examining data/masqmail-0.3.4/src/route.c
Examining data/masqmail-0.3.4/src/smtp_in.c
Examining data/masqmail-0.3.4/src/smtp_out.c
Examining data/masqmail-0.3.4/src/smtp_out.h
Examining data/masqmail-0.3.4/src/smtpsend.c
Examining data/masqmail-0.3.4/src/spool.c
Examining data/masqmail-0.3.4/src/tables.c
Examining data/masqmail-0.3.4/src/timeival.c
Examining data/masqmail-0.3.4/src/permissions.c

FINAL RESULTS:

data/masqmail-0.3.4/src/listen.c:169:6:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
					execv(argv[0], &(argv[0]));
data/masqmail-0.3.4/src/log.c:119:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vfprintf(stdout, fmt, args_copy);
data/masqmail-0.3.4/src/log.c:139:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vfprintf(file, fmt, args);
data/masqmail-0.3.4/src/log.c:155:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vfprintf(debugfile, fmt, args);
data/masqmail-0.3.4/src/log.c:159:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vfprintf(stderr, fmt, args);
data/masqmail-0.3.4/src/resolvtest.c:39:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stdout, fmt, args);
data/masqmail-0.3.4/src/smtp_in.c:145:3:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
		vsnprintf(buf, 255, fmt, args_copy);
data/masqmail-0.3.4/src/smtp_in.c:151:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(out, fmt, args);
data/masqmail-0.3.4/src/smtpsend.c:42:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stdout, fmt, args);
data/masqmail-0.3.4/src/smtpsend.c:53:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stdout, fmt, args);
data/masqmail-0.3.4/src/masqmail.c:604:2:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	srand(time(NULL));
data/masqmail-0.3.4/src/smtpsend.c:72:7:  [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, "d:p:s:H:");
data/masqmail-0.3.4/src/conf.c:93: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 ((fptr = fopen(fname, "rt")) == NULL) {
data/masqmail-0.3.4/src/conf.c:244:17:  [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).
		iface->port = atoi(p);
data/masqmail-0.3.4/src/conf.c:423:12:  [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(filename, "r")) == NULL) {
data/masqmail-0.3.4/src/conf.c:432:23:  [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).
			conf.debug_level = atoi(rval);
data/masqmail-0.3.4/src/conf.c:450:5:  [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[256];
data/masqmail-0.3.4/src/conf.c:451: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).
				FILE *fptr = fopen(rval, "rt");
data/masqmail-0.3.4/src/conf.c:528:24:  [2] (integer) atol:
  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).
			conf.max_msg_size = atol(rval);
data/masqmail-0.3.4/src/conf.c:593:12:  [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(route->filename, "r")) == NULL) {
data/masqmail-0.3.4/src/dotlock.c:39: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(hitch_name, O_WRONLY | O_CREAT | O_EXCL, 0);
data/masqmail-0.3.4/src/fail_msg.c:59: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 ((file = fopen(template, "r"))) {
data/masqmail-0.3.4/src/header.c:50: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(&local, t, sizeof(struct tm));
data/masqmail-0.3.4/src/header.c:193:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(dest, src, pp-src);
data/masqmail-0.3.4/src/header.c:202: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(dest, src, strlen(src));
data/masqmail-0.3.4/src/interface.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(&(name->sin_addr), he->h_addr, sizeof(name->sin_addr));
data/masqmail-0.3.4/src/interface.c:41:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			memcpy(&(name->sin_addr), &ia, sizeof(name->sin_addr));
data/masqmail-0.3.4/src/interface.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(&(name->sin_addr), &ia, sizeof(name->sin_addr));
data/masqmail-0.3.4/src/interface.c:60: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->sin_addr), he->h_addr, sizeof(name->sin_addr));
data/masqmail-0.3.4/src/local.c:89: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 (!(out = fopen(filename, "a"))) {
data/masqmail-0.3.4/src/log.c:75: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).
		logfile = fopen(filename, "a");
data/masqmail-0.3.4/src/log.c:90: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).
		debugfile = fopen(filename, "a");
data/masqmail-0.3.4/src/lookup.c:33: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 buf[PACKETSZ];
data/masqmail-0.3.4/src/lookup.c:39: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 name[MAX_DNSNAME];
data/masqmail-0.3.4/src/masqmail.c:108: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 ((fptr = fopen(name, "wt"))) {
data/masqmail-0.3.4/src/masqmail.c:508:18:  [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).
			debug_level = atoi(lvl);
data/masqmail-0.3.4/src/md5/hmac_md5.c:48: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 ipad[blocksize];
data/masqmail-0.3.4/src/md5/hmac_md5.c:49: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 opad[blocksize];
data/masqmail-0.3.4/src/md5/hmac_md5.c:62: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(ipad, key, keylen);
data/masqmail-0.3.4/src/md5/hmac_md5.c:65: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(opad, key, keylen);
data/masqmail-0.3.4/src/md5/hmactest.c:32: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 digest[16];
data/masqmail-0.3.4/src/md5/hmactest.c:34: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 secret[65];
data/masqmail-0.3.4/src/md5/hmactest.c:55: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(secret, "tanstaaftanstaaf", 16);
data/masqmail-0.3.4/src/md5/hmactest.c:66: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 k01[16];
data/masqmail-0.3.4/src/md5/hmactest.c:88: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 d03[50];
data/masqmail-0.3.4/src/md5/hmactest.c:92: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 k03[16];
data/masqmail-0.3.4/src/md5/md5.c:206:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			memcpy(&ctx->buffer[used], data, size);
data/masqmail-0.3.4/src/md5/md5.c:210: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(&ctx->buffer[used], data, free);
data/masqmail-0.3.4/src/md5/md5.c:221: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(ctx->buffer, data, size);
data/masqmail-0.3.4/src/md5/md5.h:23: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 buffer[64];
data/masqmail-0.3.4/src/mservdetect.c:34: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->sin_addr), &ia, sizeof(name->sin_addr));
data/masqmail-0.3.4/src/mservdetect.c:40: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->sin_addr), he->h_addr, sizeof(name->sin_addr));
data/masqmail-0.3.4/src/mservdetect.c:66: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[256];
data/masqmail-0.3.4/src/mservdetect.c:106:11:  [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).
					if ((atoi(p) >= 0) && *p) {
data/masqmail-0.3.4/src/mservdetect.c:143:9:  [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 = atoi(argv[2]);
data/masqmail-0.3.4/src/peopen.c:36: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[strlen(cmd) + 1];
data/masqmail-0.3.4/src/smtp_in.c:71:11:  [2] (integer) atol:
  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).
	*msize = atol(s);
data/masqmail-0.3.4/src/smtp_in.c:261:5:  [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[MAX_ADDRESS];
data/masqmail-0.3.4/src/smtp_out.c:164:20:  [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).
		psb->last_code = atoi(code);
data/masqmail-0.3.4/src/smtp_out.c:239:21:  [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).
				psb->max_size = atoi(arg);
data/masqmail-0.3.4/src/smtp_out.c:574:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
				sprintf(&(digest_string[i + i]), "%02x", (unsigned int) (digest[i]));
data/masqmail-0.3.4/src/smtpsend.c:77:23:  [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).
			conf.debug_level = atoi(optarg);
data/masqmail-0.3.4/src/smtpsend.c:80:18:  [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).
			server_port = atoi(optarg);
data/masqmail-0.3.4/src/spool.c:100: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).
	in = fopen(spool_file, "r");
data/masqmail-0.3.4/src/spool.c:106: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[MAX_DATALINE];
data/masqmail-0.3.4/src/spool.c:130: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).
	in = fopen(spool_file, "r");
data/masqmail-0.3.4/src/spool.c:138: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[MAX_DATALINE];
data/masqmail-0.3.4/src/spool.c:174:21:  [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).
			msg->data_size = atoi(&(buf[3]));
data/masqmail-0.3.4/src/spool.c:176:35:  [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).
			msg->received_time = (time_t) (atoi(&(buf[3])));
data/masqmail-0.3.4/src/spool.c:178: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).
			msg->warned_time = (time_t) (atoi(&(buf[3])));
data/masqmail-0.3.4/src/spool.c:236: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 ((out = fopen(tmp_file, "w"))) {
data/masqmail-0.3.4/src/spool.c:323: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 ((out = fopen(tmp_file, "w"))) {
data/masqmail-0.3.4/src/tables.c:119: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 ((fptr = fopen(fname, "rt"))) {
data/masqmail-0.3.4/src/timeival.c:36:8:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	val = atoi(buf);
data/masqmail-0.3.4/src/accept.c:80: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).
			gint len1 = strlen(line1);
data/masqmail-0.3.4/src/accept.c:86: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).
					data_size += strlen(line1);
data/masqmail-0.3.4/src/accept.c:153: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).
			data_size += strlen(line1);
data/masqmail-0.3.4/src/base64/base64.c:84: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).
	gchar *out = g_malloc((strlen(buf) + 3) + 1 +1);
data/masqmail-0.3.4/src/base64/base64.c:85: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).
	memset(out, 0, (strlen(buf) + 3) + 1 +1);
data/masqmail-0.3.4/src/conf.c:70: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).
		if (strncasecmp(*str, rval, strlen(*str)) == 0)
data/masqmail-0.3.4/src/conf.c:77: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).
		if (strncasecmp(*str, rval, strlen(*str)) == 0)
data/masqmail-0.3.4/src/conf.c:166: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).
		for (p=item+strlen(item)-1; isspace(*p) || *p=='>'; p--) {
data/masqmail-0.3.4/src/conf.c:257:11:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for (c = fgetc(in); (c == '#' || isspace(c)) && c != EOF;
data/masqmail-0.3.4/src/conf.c:258:8:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		 c = fgetc(in)) {
data/masqmail-0.3.4/src/conf.c:261:13:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			for (c = fgetc(in); (c != '\n') && (c != EOF); c = fgetc(in));
data/masqmail-0.3.4/src/conf.c:261:55:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			for (c = fgetc(in); (c != '\n') && (c != EOF); c = fgetc(in));
data/masqmail-0.3.4/src/conf.c:276:11:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for (c = fgetc(in); c != EOF && c != '\n'; c = fgetc(in));
data/masqmail-0.3.4/src/conf.c:276:49:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for (c = fgetc(in); c != EOF && c != '\n'; c = fgetc(in));
data/masqmail-0.3.4/src/conf.c:287:11:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for (c = fgetc(in); c != EOF && isspace(c); c = fgetc(in)) {
data/masqmail-0.3.4/src/conf.c:287:50:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	for (c = fgetc(in); c != EOF && isspace(c); c = fgetc(in)) {
data/masqmail-0.3.4/src/conf.c:307:6:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	c = fgetc(in);
data/masqmail-0.3.4/src/conf.c:314:7:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = fgetc(in);
data/masqmail-0.3.4/src/conf.c:344:6:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	c = fgetc(in);
data/masqmail-0.3.4/src/conf.c:352:8:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			c = fgetc(in);
data/masqmail-0.3.4/src/conf.c:358:7:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = fgetc(in);
data/masqmail-0.3.4/src/conf.c:369:8:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			c = fgetc(in);
data/masqmail-0.3.4/src/conf.c:397:11:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if ((c = fgetc(in) == '=')) {
data/masqmail-0.3.4/src/header.c:63:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len += strlen(buf + len);
data/masqmail-0.3.4/src/header.c:140: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).
	int len = strlen(hdr->header);
data/masqmail-0.3.4/src/header.c:165: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).
	tmp = malloc(len + 2 * (len/maxlen) * strlen("\n\t"));
data/masqmail-0.3.4/src/header.c:171: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).
	while (strlen(src) > maxlen) {
data/masqmail-0.3.4/src/header.c:202: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).
	memcpy(dest, src, strlen(src));
data/masqmail-0.3.4/src/header.c:203: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).
	dest += strlen(src);
data/masqmail-0.3.4/src/log.c:62:22:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	mode_t saved_mode = umask(066);
data/masqmail-0.3.4/src/log.c:98:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(saved_mode);
data/masqmail-0.3.4/src/md5/hmactest.c:46: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).
	hmac_md5(msgid, strlen(msgid), "tanstaaftanstaaf", 16, digest);
data/masqmail-0.3.4/src/md5/hmactest.c:56: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).
	hmac_md5(msgid, strlen(msgid), secret, 64, digest);
data/masqmail-0.3.4/src/md5/hmactest.c:71: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).
	hmac_md5(d01, strlen(d01), k01, sizeof(k01), digest);
data/masqmail-0.3.4/src/md5/hmactest.c:81: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).
	hmac_md5(d02, strlen(d02), k02, strlen(k02), digest);
data/masqmail-0.3.4/src/md5/hmactest.c:81: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).
	hmac_md5(d02, strlen(d02), k02, strlen(k02), digest);
data/masqmail-0.3.4/src/online.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(output) == 0) {
data/masqmail-0.3.4/src/peopen.c:36: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).
	char buf[strlen(cmd) + 1];
data/masqmail-0.3.4/src/queue.c:78:45:  [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).
		uid = g_strndup(&(gl.gl_pathv[idx_arr[i]][strlen(conf.spool_dir) + 7]), 13);
data/masqmail-0.3.4/src/readsock.c:66:6:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	c = fgetc(in);
data/masqmail-0.3.4/src/readsock.c:68:7:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = fgetc(in);
data/masqmail-0.3.4/src/readsock.c:78:6:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	c = fgetc(in);
data/masqmail-0.3.4/src/readsock.c:81:7:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = fgetc(in);
data/masqmail-0.3.4/src/readtest.c:14:58:  [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).
	printf("ret = %d, size = %d, strlen = %d\n", ret, size, strlen(buf));
data/masqmail-0.3.4/src/smtp_in.c:51:43:  [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 (strncasecmp(smtp_cmds[i].cmd, line, strlen(smtp_cmds[i].cmd)) == 0) {
data/masqmail-0.3.4/src/smtp_out.c:572:50:  [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).
			hmac_md5(chall, chall_size, psb->auth_secret, strlen(psb->auth_secret), digest);
data/masqmail-0.3.4/src/smtp_out.c:582:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			reply64 = base64_encode(reply, strlen(reply));
data/masqmail-0.3.4/src/smtp_out.c:623:45:  [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).
			reply64 = base64_encode(psb->auth_login, strlen(psb->auth_login));
data/masqmail-0.3.4/src/smtp_out.c:636:48:  [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).
					reply64 = base64_encode(psb->auth_secret, strlen(psb->auth_secret));
data/masqmail-0.3.4/src/spool.c:32:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((c = getc(in)) != '\n' && (c != EOF)) {
data/masqmail-0.3.4/src/spool.c:162:47:  [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 (strncasecmp(prot_names[i], &(buf[3]), strlen(prot_names[i])) == 0) {
data/masqmail-0.3.4/src/spool.c:308:35:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	mode_t saved_mode = saved_mode = umask(026);
data/masqmail-0.3.4/src/spool.c:357:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(saved_mode);

ANALYSIS SUMMARY:

Hits = 127
Lines analyzed = 11123 in approximately 0.31 seconds (36268 lines/second)
Physical Source Lines of Code (SLOC) = 7916
Hits@level = [0] 137 [1]  53 [2]  62 [3]   2 [4]  10 [5]   0
Hits@level+ = [0+] 264 [1+] 127 [2+]  74 [3+]  12 [4+]  10 [5+]   0
Hits/KSLOC@level+ = [0+] 33.3502 [1+] 16.0435 [2+] 9.34816 [3+] 1.51592 [4+] 1.26326 [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.