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/bsd-mailx-8.1.2-0.20180807cvs/cmdtab.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/rcv.h
Examining data/bsd-mailx-8.1.2-0.20180807cvs/version.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/temp.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/strings.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/getname.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/v7.local.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/list.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/head.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/pathnames.h
Examining data/bsd-mailx-8.1.2-0.20180807cvs/vars.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/cmd2.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/quit.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/collect.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/edit.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/names.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/extern.h
Examining data/bsd-mailx-8.1.2-0.20180807cvs/lex.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/aux.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/main.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/send.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/def.h
Examining data/bsd-mailx-8.1.2-0.20180807cvs/fio.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/popen.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/tty.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/glob.c
Examining data/bsd-mailx-8.1.2-0.20180807cvs/glob.h

FINAL RESULTS:

data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:236:2:  [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.
	snprintf(fmtline, sizeof(fmtline), fmt, curind, dispc, mesg, visname,
data/bsd-mailx-8.1.2-0.20180807cvs/cmd2.c:169: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.
	if (access(file, F_OK) >= 0)
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:305:3:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		execv(_PATH_BSHELL, argp);
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:176:6:  [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(header, optarg);
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:180:6:  [4] (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).
					strcat(header, optarg);
data/bsd-mailx-8.1.2-0.20180807cvs/popen.c:226: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[0], argv);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:448:3:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		execv(cp, argv);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:620:10:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				     fprintf(fo, name ": " value "\n", ##__VA_ARGS__), gotcha++
data/bsd-mailx-8.1.2-0.20180807cvs/v7.local.c:97:12:  [4] (misc) getlogin:
  It's often easy to fool getlogin. Sometimes it does not work at all,
  because some program messed up the utmp file. Often, it gives only the
  first 8 characters of the login name. The user currently logged in on the
  controlling tty of our program need not be the user who started it. Avoid
  getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid())
  and extract the desired information instead.
	if ((np = getlogin()) != NULL)
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:289: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.
		ed = getenv("VISUAL");
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:291: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.
		ed = getenv("EDITOR");
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:91: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 ((cmd = getenv("PAGER")))
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:93: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 ((cmd = getenv("LISTER")))
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:95: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 ((cmd = getenv("SHELL")))
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:97: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 ((cmd = getenv("EDITOR")))
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:99: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 ((cmd = getenv("VISUAL")))
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:101: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 ((cmd = getenv("MBOX")))
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:103: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 ((cmd = getenv("DEAD")))
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:105: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 ((cmd = getenv("REPLYTO")))
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:124:14:  [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.
	while ((i = getopt(argc, argv, "EINa:b:c:dfeinr:s:u:v")) != -1) {
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:280: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 ((rc = getenv("MAILRC")) == 0)
data/bsd-mailx-8.1.2-0.20180807cvs/temp.c:75: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 ((cp = getenv("HOME")) == NULL || *cp == '\0' ||
data/bsd-mailx-8.1.2-0.20180807cvs/v7.local.c:57: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 ((mbox = getenv("MAIL")) && stat(mbox, &sb) == 0 &&
data/bsd-mailx-8.1.2-0.20180807cvs/v7.local.c:91: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 ((np = getenv("USER")) != NULL)
data/bsd-mailx-8.1.2-0.20180807cvs/v7.local.c:93: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 ((np = getenv("LOGNAME")) != NULL)
data/bsd-mailx-8.1.2-0.20180807cvs/vars.c:112: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.
	else if ((env = getenv(name)))
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:56:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		(void)memcpy(new, str, size);
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:72:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			(void)memcpy(new, old, oldsize);
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:75:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		(void)memcpy(new + oldsize, str, newsize);
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:129: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 linebuf[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:157: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 line2[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:196:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			(void)memcpy(cp, cp2, c);
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:547: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 namebuf[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:548: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 linebuf[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:630:7:  [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.
isign(char *field, struct ignoretab ignore[2])
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:632: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 realfld[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:154:45:  [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 ((cp = value("screen")) != NULL && (s = atoi(cp)) > 0)
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.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 headline[LINESIZE], *subjline, dispc, curind;
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:185: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 visname[LINESIZE], vissub[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:186: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 pbuf[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:187: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 fmtline[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:365: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).
		if (page || nlines > (*cp ? atoi(cp) : realscreenheight)) {
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:409: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 *valtop, linebuf[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:415:10:  [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).
		topl = atoi(valtop);
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:482: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 dirname[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:483: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 cmd[BUFSIZ];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd2.c:383: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 field[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c:52: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 cmd[BUFSIZ];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c:95: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 bangbuf[BUFSIZ];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c:96: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 lastbang[BUFSIZ];
data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c:376: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 varbuf[BUFSIZ], **ap, **p;
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:63: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 linebuf[LINESIZE], tempname[PATHSIZE], *cp;
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:78:12:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	if ((fd = mkstemp(tempname)) == -1 ||
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:492: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 *shell, tempname[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:499:12:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	if ((fd = mkstemp(tempname)) == -1 ||
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:97:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			char buf[100];
data/bsd-mailx-8.1.2-0.20180807cvs/edit.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 *edit, tempname[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:182:11:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	if ((t = mkstemp(tempname)) == -1 ||
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:79: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 linebuf[LINESIZE], pathbuf[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:83:11:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	if ((c = mkstemp(pathbuf)) == -1 || (mestmp = Fdopen(c, "r+")) == NULL)
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:430: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 xname[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:431: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 cmdbuf[PATHSIZE];		/* also used for file names */
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:561: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[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/glob.h:58: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.
DEBIAN_EXTERN char	mailname[PATHSIZE];		/* Name of current file */
data/bsd-mailx-8.1.2-0.20180807cvs/glob.h:59: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.
DEBIAN_EXTERN char	prevfile[PATHSIZE];		/* Name of previous file */
data/bsd-mailx-8.1.2-0.20180807cvs/glob.h:64: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.
DEBIAN_EXTERN char	lexstring[STRINGLEN];		/* String from TSTRING, scan() */
data/bsd-mailx-8.1.2-0.20180807cvs/glob.h:67: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.
DEBIAN_EXTERN char	*string_stack[REGDEP];		/* Stack of regretted strings */
data/bsd-mailx-8.1.2-0.20180807cvs/head.c:52: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 parbuf[BUFSIZ];
data/bsd-mailx-8.1.2-0.20180807cvs/head.c:98: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 word[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:67: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 tempname[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:116: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 ((i = open(name, O_WRONLY, 0)) < 0)
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:135: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 ((itf = fopen(tempname, "re")) == NULL)
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:207: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 linebuf[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:290: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 word[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:291: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 *arglist[MAXARGC];
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:635: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 fname[PATHSIZE], zname[PATHSIZE], *ename;
data/bsd-mailx-8.1.2-0.20180807cvs/list.c:115: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 *namelist[NMLSIZE], *bufp;
data/bsd-mailx-8.1.2-0.20180807cvs/list.c:690:1:  [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 lastscan[STRINGLEN];
data/bsd-mailx-8.1.2-0.20180807cvs/names.c:239: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 tempname[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/names.c:244:14:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
			if ((fd = mkstemp(tempname)) == -1 ||
data/bsd-mailx-8.1.2-0.20180807cvs/names.c:250:12:  [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).
			image = open(tempname, O_RDWR | O_CLOEXEC);
data/bsd-mailx-8.1.2-0.20180807cvs/popen.c:71: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 ((fp = fopen(file, mode)) != NULL) {
data/bsd-mailx-8.1.2-0.20180807cvs/popen.c:219: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 *argv[100];
data/bsd-mailx-8.1.2-0.20180807cvs/popen.c:274:3:  [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).
		open(_PATH_DEVNULL, O_RDONLY, 0);
data/bsd-mailx-8.1.2-0.20180807cvs/popen.c:454: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[sizeof(_PATH_LOCKSPOOL) + LOGIN_NAME_MAX + 1];
data/bsd-mailx-8.1.2-0.20180807cvs/popen.c:482: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 lockpath[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:71: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 *mbox, tempname[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:113:13:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
		if ((fd = mkstemp(tempname)) == -1 ||
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:195:13:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
		if ((fd = mkstemp(tempname)) == -1 ||
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:225:14:  [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 ((fdx = open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600)) != -1)
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:395: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 tempname[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:416:13:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
		if ((fd = mkstemp(tempname)) == -1 ||
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:59: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 line[LINESIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:60: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 visline[4 * LINESIZE - 3];
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:262: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 statout[3];
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:332: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 *argv[8];
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:521: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 tempname[PATHSIZE];
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:525:12:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	if ((fd = mkstemp(tempname)) == -1 ||
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:676: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[BUFSIZ];
data/bsd-mailx-8.1.2-0.20180807cvs/tty.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 canonb[BUFSIZ];
data/bsd-mailx-8.1.2-0.20180807cvs/v7.local.c:76:8:  [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(mailname, O_CREAT | O_TRUNC | O_WRONLY, 0600);
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:53: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 size = strlen(str) + 1;
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:67: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).
	int newsize = strlen(str) + 1;
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:68: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).
	int oldsize = old ? strlen(old) + 1 : 0;
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:184:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			ungetc(c = getc(f), f);
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:442:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if ((nbuf = malloc(strlen(name) + 1)) == NULL)
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:532: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).
	if ((cp = realloc(nbuf, strlen(nbuf) + 1)) != NULL)
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:566: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).
	for (cp2 = &namebuf[strlen(namebuf)];
data/bsd-mailx-8.1.2-0.20180807cvs/aux.c:654:7:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
		    equal(igp->i_field, realfield))
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:263: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).
		cc += strlen(cp->c_name) + 2;
data/bsd-mailx-8.1.2-0.20180807cvs/cmd1.c:266: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).
			cc = strlen(cp->c_name) + 2;
data/bsd-mailx-8.1.2-0.20180807cvs/cmd2.c:222: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).
	cp = strlen(linebuf) + linebuf - 1;
data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c:105: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).
			if (n < strlen(lastbang)) {
data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c:112: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).
			cp2 += strlen(lastbang);
data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c:113: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).
			n -= strlen(lastbang);
data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c:267: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(subj) + 5;
data/bsd-mailx-8.1.2-0.20180807cvs/cmd3.c:404:7:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
		if (equal(varbuf, "")) {
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:337:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while ((t = getc(fbuf)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:352:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while ((t = getc(collf)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:442:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((c = getc(fp)) != EOF) {
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:619:6:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	c = umask(077);
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:621:8:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	(void)umask(c);
data/bsd-mailx-8.1.2-0.20180807cvs/collect.c:624:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((c = getc(fp)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/def.h:77:9:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
#define	equal(a, b)	(strcmp(a,b)==0)/* A nice function to string compare */
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:122:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			c2 = getc(fp);
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:123:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			c1 = getc(fp);
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:141:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while ((c = getc(fp)) != EOF) {
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:193:30:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while (--size >= 0 && (t = getc(fp)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/edit.c:196:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((t = getc(fp)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:63:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((nread = read(fd, buf, len)) == -1 && errno == EINTR)
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:116: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).
		count = strlen(linebuf);
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:182: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).
	c = strlen(linebuf);
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:239: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).
		n = strlen(linebuf);
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:480: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).
				} else if (strlen(p.we_wordv[0]) >= PATHSIZE) {
data/bsd-mailx-8.1.2-0.20180807cvs/fio.c:483:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
					strncpy(xname, p.we_wordv[0], PATHSIZE);
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:250: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).
			if ((n = strlen(linebuf)) == 0)
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:662:32:  [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 (strncmp(fname, mailname, strlen(fname)) == 0) {
data/bsd-mailx-8.1.2-0.20180807cvs/lex.c:664: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).
			    mailname + strlen(fname));
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:132: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(optarg) >= LOGIN_NAME_MAX)
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:175: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).
				if ((header = (char *)malloc(strlen(optarg)+1)) != NULL)
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:178: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 ((header = (char *)realloc(header, strlen(optarg)+strlen(header)+2)) != NULL) {
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:178: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).
				if ((header = (char *)realloc(header, strlen(optarg)+strlen(header)+2)) != NULL) {
data/bsd-mailx-8.1.2-0.20180807cvs/main.c:179:6:  [1] (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 character.
					strcat(header, "\n");
data/bsd-mailx-8.1.2-0.20180807cvs/names.c:92:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if ((nbuf = malloc(strlen(line) + 1)) == NULL)
data/bsd-mailx-8.1.2-0.20180807cvs/names.c:130: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).
		s += strlen(p->n_name) + 1;
data/bsd-mailx-8.1.2-0.20180807cvs/names.c:261:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while ((c = getc(fo)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/names.c:319:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while ((c = getc(fin)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/names.c:598:36:  [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).
		    strncasecmp(p->n_name, name, strlen(name)) == 0 &&
data/bsd-mailx-8.1.2-0.20180807cvs/names.c:599: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).
		    *(p->n_name+strlen(name)) == '@')) {
data/bsd-mailx-8.1.2-0.20180807cvs/popen.c:468:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (getc(lockfp) != '1') {
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:118:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((c = getc(fbuf)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:123:8:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			c = getc(fbuf);
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:212:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while ((c = getc(abuf)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:261:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = getc(ibuf);
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:266:8:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			c = getc(ibuf);
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:305:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((c = getc(rbuf)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:349:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((c = getc(res)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:363:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((c = getc(res)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:432:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((c = getc(ibuf)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/quit.c:465:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((c = getc(ibuf)) != EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:102:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		count -= length = strlen(line);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:216: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).
		count -= c = strlen(line);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:246:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if ((c = getc(ibuf)) != EOF && putc(c, obuf) == EOF)
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:539:6:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	c = getc(fi);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:542:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = getc(fi);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:647: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).
	col = strlen(str);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:653: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(np->n_name);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:680:6:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	m = umask(077);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:682:8:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	(void)umask(m);
data/bsd-mailx-8.1.2-0.20180807cvs/send.c:698:24:  [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).
		(void)fwrite(buf, 1, strlen(buf), fo);
data/bsd-mailx-8.1.2-0.20180807cvs/temp.c:54: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).
	cp = tmpdir + strlen(tmpdir) - 1;
data/bsd-mailx-8.1.2-0.20180807cvs/temp.c:76: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(cp) >= PATHSIZE)
data/bsd-mailx-8.1.2-0.20180807cvs/tty.c:194:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (src != NULL && strlen(src) > sizeof(canonb) - 2) {
data/bsd-mailx-8.1.2-0.20180807cvs/tty.c:252: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).
		cp = strlen(canonb) > 0 ? canonb : NULL;
data/bsd-mailx-8.1.2-0.20180807cvs/tty.c:256:6:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
	if (equal("", canonb))
data/bsd-mailx-8.1.2-0.20180807cvs/tty.c:334:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	n = read(t->fdin, &c, 1);
data/bsd-mailx-8.1.2-0.20180807cvs/vars.c:136:31:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
		if (*vp->v_name == *name && equal(vp->v_name, name))
data/bsd-mailx-8.1.2-0.20180807cvs/vars.c:150:31:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
		if (*gh->g_name == *name && equal(gh->g_name, name))

ANALYSIS SUMMARY:

Hits = 178
Lines analyzed = 10383 in approximately 0.32 seconds (32675 lines/second)
Physical Source Lines of Code (SLOC) = 7019
Hits@level = [0] 113 [1]  77 [2]  75 [3]  17 [4]   9 [5]   0
Hits@level+ = [0+] 291 [1+] 178 [2+] 101 [3+]  26 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 41.4589 [1+] 25.3597 [2+] 14.3895 [3+] 3.70423 [4+] 1.28223 [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.