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/posh-0.14.1/alloc.c
Examining data/posh-0.14.1/c_test.c
Examining data/posh-0.14.1/c_test.h
Examining data/posh-0.14.1/conf-end.h
Examining data/posh-0.14.1/edit.h
Examining data/posh-0.14.1/eval.c
Examining data/posh-0.14.1/exec.c
Examining data/posh-0.14.1/expand.h
Examining data/posh-0.14.1/expr.c
Examining data/posh-0.14.1/history.c
Examining data/posh-0.14.1/io.c
Examining data/posh-0.14.1/jobs.c
Examining data/posh-0.14.1/ksh_dir.h
Examining data/posh-0.14.1/ksh_limval.h
Examining data/posh-0.14.1/ksh_stat.h
Examining data/posh-0.14.1/ksh_time.h
Examining data/posh-0.14.1/ksh_wait.h
Examining data/posh-0.14.1/lex.c
Examining data/posh-0.14.1/lex.h
Examining data/posh-0.14.1/main.c
Examining data/posh-0.14.1/misc.c
Examining data/posh-0.14.1/path.c
Examining data/posh-0.14.1/proto.h
Examining data/posh-0.14.1/sh.h
Examining data/posh-0.14.1/shf.c
Examining data/posh-0.14.1/shf.h
Examining data/posh-0.14.1/src/builtins.c
Examining data/posh-0.14.1/src/compat.c
Examining data/posh-0.14.1/src/compat.h
Examining data/posh-0.14.1/src/times.c
Examining data/posh-0.14.1/syn.c
Examining data/posh-0.14.1/table.c
Examining data/posh-0.14.1/table.h
Examining data/posh-0.14.1/trap.c
Examining data/posh-0.14.1/tree.c
Examining data/posh-0.14.1/tree.h
Examining data/posh-0.14.1/tty.c
Examining data/posh-0.14.1/tty.h
Examining data/posh-0.14.1/var.c

FINAL RESULTS:

data/posh-0.14.1/path.c:251:28:  [5] (buffer) gets:
  Does not check for buffer overflows (CWE-120, CWE-20). Use fgets() instead.
	printf("enter CDPATH: "); gets(cdpath);
data/posh-0.14.1/path.c:252:25:  [5] (buffer) gets:
  Does not check for buffer overflows (CWE-120, CWE-20). Use fgets() instead.
	printf("enter PWD: "); gets(pwd);
data/posh-0.14.1/path.c:254:31:  [5] (buffer) gets:
  Does not check for buffer overflows (CWE-120, CWE-20). Use fgets() instead.
		if (printf("Enter file: "), gets(file) == 0)
data/posh-0.14.1/proto.h:273:12:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
extern int readlink (const char *path, char *buf, int bufsize);
data/posh-0.14.1/conf-end.h:40:37:  [4] (shell) system:
  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.
  # error pdksh needs interruptable system calls.
data/posh-0.14.1/eval.c:1124:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(dp, sp);
data/posh-0.14.1/jobs.c:1361:4:  [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(buf, sigtraps[WSTOPSIG(p->status)].mess);
data/posh-0.14.1/jobs.c:1383:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
				strcpy(buf, sigtraps[WTERMSIG(p->status)].mess);
data/posh-0.14.1/main.c:733:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
				strcpy(t->name, tp->name);
data/posh-0.14.1/misc.c:51:13:  [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).
	return s ? strcpy((char*) alloc((size_t)strlen(s)+1, ap), s) : NULL;
data/posh-0.14.1/proto.h:100:37:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
data/posh-0.14.1/proto.h:102:26:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				GCC_FUNC_ATTR(format(printf, 2, 3));
data/posh-0.14.1/proto.h:104:26:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				GCC_FUNC_ATTR(format(printf, 1, 2));
data/posh-0.14.1/proto.h:106:26:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				GCC_FUNC_ATTR(format(printf, 2, 3));
data/posh-0.14.1/proto.h:109:26:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				GCC_FUNC_ATTR(format(printf, 1, 2));
data/posh-0.14.1/proto.h:111:26:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				GCC_FUNC_ATTR(format(printf, 1, 2));
data/posh-0.14.1/proto.h:115:26:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				GCC_FUNC_ATTR(format(printf, 1, 2));
data/posh-0.14.1/proto.h:152:37:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
data/posh-0.14.1/proto.h:268:12:  [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.
extern int fprintf (FILE *fp, const char *fmt, ...);
data/posh-0.14.1/sh.h:258:29:  [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.
#define	eaccess(path, mode)	access(path, mode)
data/posh-0.14.1/shf.c:1266:17:  [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.
	    nwritten = vsnprintf(buf, bufsiz, fmt, args);
data/posh-0.14.1/var.c:1090:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(new->name, vp->name);
data/posh-0.14.1/exec.c:419: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.
	if ((optc = getopt(noargc, ap, "+pvV")) == 'p')
data/posh-0.14.1/src/builtins.c:43:17:  [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 ((optc = getopt(argc, argv, "")) != -1) {
data/posh-0.14.1/src/builtins.c:119:17:  [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 ((optc = getopt(argc, argv, "LP")) != -1) {
data/posh-0.14.1/src/builtins.c:247:17:  [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 ((optc = getopt(argc, argv, "+vV")) != -1) {
data/posh-0.14.1/src/builtins.c:305:17:  [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 ((optc = getopt(argc, argv, "")) != -1) {
data/posh-0.14.1/src/builtins.c:472:17:  [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 ((optc = getopt(argc, argv, "")) != -1) {
data/posh-0.14.1/src/builtins.c:609:17:  [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 ((optc = getopt(argc, argv, "p")) != -1) {
data/posh-0.14.1/src/builtins.c:672:17:  [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 ((optc = getopt(argc, argv, "+")) != -1) {
data/posh-0.14.1/src/builtins.c:744:9:  [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.
	optc = getopt(noargc, wp, options);
data/posh-0.14.1/src/builtins.c:794:17:  [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 ((optc = getopt(argc, argv, "ls:")) != -1) {
data/posh-0.14.1/src/builtins.c:874:17:  [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 ((optc = getopt(argc, argv, "LP")) != -1)
data/posh-0.14.1/src/builtins.c:924:17:  [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 ((optc = getopt(argc, argv, "r")) != -1)
data/posh-0.14.1/src/builtins.c:1085:17:  [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 ((optc = getopt(argc, argv, "")) != -1) {
data/posh-0.14.1/src/builtins.c:1121:17:  [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 ((optc = getopt(argc, argv, "")) != -1) {
data/posh-0.14.1/src/builtins.c:1193:17:  [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 ((optc = getopt(argc, argv, "S")) != -1) {
data/posh-0.14.1/src/builtins.c:1316:17:  [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 ((optc = getopt(argc, argv, "fv")) != -1) {
data/posh-0.14.1/src/builtins.c:1351:17:  [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 ((optc = getopt(argc, argv, "")) != -1) {
data/posh-0.14.1/src/compat.c:42:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  pwd = getenv ("PWD");
data/posh-0.14.1/src/compat.c:66:9:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	return realpath(name, buf);
data/posh-0.14.1/var.c:987:3:  [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((unsigned int)intval(vp));
data/posh-0.14.1/c_test.c:37: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	op_text[4];
data/posh-0.14.1/eval.c:713: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 q[20];
data/posh-0.14.1/eval.c:1084: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(xp, name, len);
data/posh-0.14.1/eval.c:1274:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
				memcpy(new, start, l1);
data/posh-0.14.1/eval.c:1275:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
				memcpy(new + l1, field_start, l2);
data/posh-0.14.1/eval.c:1276:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
				memcpy(new + l1 + l2, brace_end, l3);
data/posh-0.14.1/exec.c:37: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 clexec_tab[MAXFD+1];
data/posh-0.14.1/exec.c:644: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[LINE];
data/posh-0.14.1/exec.c:649:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd = open(tp->str, O_RDONLY)) >= 0) {
data/posh-0.14.1/exec.c:932: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(xp, sp, p - sp);
data/posh-0.14.1/exec.c:938: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(xp, name, namelen);
data/posh-0.14.1/exec.c:1049: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).
		u = open(cp, flags, 0666);
data/posh-0.14.1/exec.c:1134:31:  [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 (!(shf = h->shf) || (fd = open(h->name, O_RDONLY, 0)) < 0) {
data/posh-0.14.1/expr.c:62: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		name[4];
data/posh-0.14.1/expr.c:217: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 tbuf[2];
data/posh-0.14.1/history.c:97:5:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
				strcat(editor, " $_");
data/posh-0.14.1/history.c:361: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(xp, s, len);		/* first part */
data/posh-0.14.1/history.c:363: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(xp, rep, rep_len);	/* replacement */
data/posh-0.14.1/history.c:372: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(xp, s, len);
data/posh-0.14.1/history.c:654: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(p, cmd, clen);
data/posh-0.14.1/history.c:697: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 ((fh = fopen(hname, "r"))) {
data/posh-0.14.1/history.c:701: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 hline[LINE + 1];
data/posh-0.14.1/history.c:748:22:  [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 (hname && (fh = fopen(hname, "w")))
data/posh-0.14.1/history.c:843: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).
	if ((fd = open(hname, O_RDWR|O_CREAT|O_APPEND, 0600)) < 0)
data/posh-0.14.1/history.c:940: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	nfile[1024];
data/posh-0.14.1/history.c:1102: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	hdr[5];
data/posh-0.14.1/io.c:185:25:  [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.
				c, ((const unsigned char *) mem)[i + j]);
data/posh-0.14.1/io.c:468:7:  [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).
	fd = mkstemp(path);
data/posh-0.14.1/jobs.c:61: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 command[48];	/* process command string */
data/posh-0.14.1/jobs.c:470: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).
				int fd = open("/dev/null", 0);
data/posh-0.14.1/jobs.c:1334: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[64];
data/posh-0.14.1/jobs.c:1358: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(buf, "Running", 8);
data/posh-0.14.1/jobs.c:1367:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
				memcpy(buf, "Done", 5);
data/posh-0.14.1/lex.c:1146: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 nbuf[32];
data/posh-0.14.1/lex.h:20: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	ugbuf[2];	/* buffer for ungetsc() (SREREAD) and
data/posh-0.14.1/lex.h:105: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.
EXTERN	char	ident [IDENT+1];
data/posh-0.14.1/main.c:206:11:  [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(current_wd, simplified, len);
data/posh-0.14.1/misc.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 m[(int) FNFLAGS + 1];
data/posh-0.14.1/misc.c:249: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 cmd_opts[NELEM(options) + 3]; /* o:\0 */
data/posh-0.14.1/misc.c:250: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 set_opts[NELEM(options) + 3]; /* o;\0 */
data/posh-0.14.1/misc.c:261:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy(cmd_opts, "o:"); /* see cmd_opts[] declaration */
data/posh-0.14.1/misc.c:263:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy(set_opts, "o;"); /* see set_opts[] declaration */
data/posh-0.14.1/misc.c:402: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 tbuf[64];
data/posh-0.14.1/misc.c:918: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(dst, src, len);
data/posh-0.14.1/path.c:113: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(xp, cwd, len);
data/posh-0.14.1/path.c:121: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(xp, plist, plen);
data/posh-0.14.1/path.c:131: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(xp, file, len);
data/posh-0.14.1/path.c:239: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(current_wd, p, len);
data/posh-0.14.1/path.c:249: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	*cp, cdpath[256], pwd[256], file[256], result[256];
data/posh-0.14.1/proto.h:266:13:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
extern void bcopy (const void *src, void *dst, size_t size);
data/posh-0.14.1/sh.h:397: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.
EXTERN	char shell_flags [FNFLAGS];
data/posh-0.14.1/sh.h:527: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[2];	/* for bad option OPTARG value */
data/posh-0.14.1/shf.c:46: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(name, oflags, mode);
data/posh-0.14.1/shf.c:521: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(buf, shf->rp, ncopy);
data/posh-0.14.1/shf.c:567: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(buf, (char *) shf->rp, ncopy);
data/posh-0.14.1/shf.c:717: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(shf->wp, buf, ncopy);
data/posh-0.14.1/shf.c:750: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(shf->wp, buf, nbytes);
data/posh-0.14.1/shf.c:858: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		numbuf[(BITS(long) + 2) / 3 + 1];
data/posh-0.14.1/shf.c:870: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		fpbuf[FPBUF_SIZE];
data/posh-0.14.1/shf.c:1105:13:  [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(s, p, decpt);
data/posh-0.14.1/shf.c:1137:12:  [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(s, p, precision);
data/posh-0.14.1/shf.c:1166:12:  [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(s, p, tmp);
data/posh-0.14.1/src/builtins.c:696: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[3];
data/posh-0.14.1/src/builtins.c:1211: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[18];
data/posh-0.14.1/src/times.c:54: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 opts[1];
data/posh-0.14.1/src/times.c:138: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 temp[22]; /* enough for 64 bit clock_t */
data/posh-0.14.1/syn.c:687: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 redir[6];	/* 2<<- is the longest redirection, I think */
data/posh-0.14.1/table.c:30: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(p->name, n, len);
data/posh-0.14.1/table.c:51: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(p->name, n, len);
data/posh-0.14.1/table.h: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	name[4];	/* name -- variable length */
data/posh-0.14.1/tree.c:518: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.
	return memcpy(alloc(len, ap), wp, len);
data/posh-0.14.1/tty.c:111:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((tfd = open("/dev/tty", O_RDWR, 0)) < 0) {
data/posh-0.14.1/tty.c:121:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			if (s && (fd = open(s, O_RDWR, 0)) >= 0) {
data/posh-0.14.1/tty.c:123: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).
				tfd = open("/dev/tty", O_RDWR, 0);
data/posh-0.14.1/var.c:310:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		static char strbuf[1 + 2 + 1 + BITS(long) + 1];
data/posh-0.14.1/var.c:513: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(p, s, olen + 1);
data/posh-0.14.1/var.c:532: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(vp->val.s = xp, vp->name, namelen);
data/posh-0.14.1/var.c:536: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(xp, val, vallen);
data/posh-0.14.1/c_test.c:308:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		int len = strlen(opnd1);
data/posh-0.14.1/eval.c:419: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).
					len = strlen(dp) + 1;
data/posh-0.14.1/eval.c:436: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).
					    (debunk(s, s, strlen(s) + 1), s));
data/posh-0.14.1/eval.c:579:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					XPput(*wp, debunk(p, p, strlen(p) + 1));
data/posh-0.14.1/eval.c:747: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).
			c = strlen(p);
data/posh-0.14.1/eval.c:945:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		XPput(*wp, debunk(cp, cp, strlen(cp) + 1));
data/posh-0.14.1/eval.c:1044: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).
		se = sp + strlen(sp);
data/posh-0.14.1/eval.c:1057: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).
		xp += strlen(xp);
data/posh-0.14.1/eval.c:1082: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).
			len = strlen(d->d_name) + 1;
data/posh-0.14.1/exec.c:650:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ((n = read(fd, buf, LINE - 1)) > 0)
data/posh-0.14.1/exec.c:922: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).
	namelen = strlen(name) + 1;
data/posh-0.14.1/exec.c:929: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).
			p = sp + strlen(sp);
data/posh-0.14.1/history.c:96:27:  [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).
				editor = str_nsave(p, strlen(p) + 4, ATEMP);
data/posh-0.14.1/history.c:347: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).
		int pat_len = strlen(pat);
data/posh-0.14.1/history.c:348: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).
		int rep_len = strlen(rep);
data/posh-0.14.1/history.c:370: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(s) + 1;
data/posh-0.14.1/history.c:514: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(str);
data/posh-0.14.1/history.c:628: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).
	cp = *hp + strlen(*hp);
data/posh-0.14.1/history.c:646: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).
	hlen = strlen(*histptr);
data/posh-0.14.1/history.c:647: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).
	clen = strlen(cmd);
data/posh-0.14.1/history.c:691:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		hname = alloc(len = strlen(home) + strlen(f) + 2, APERM);
data/posh-0.14.1/history.c:691:38:  [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).
		hname = alloc(len = strlen(home) + strlen(f) + 2, APERM);
data/posh-0.14.1/history.c:1143:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	(void) write(histfd, cmd, strlen(cmd)+1);
data/posh-0.14.1/io.c:367:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (coproc.read >= 0 && fd == coproc.read) {
data/posh-0.14.1/io.c:367:39:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (coproc.read >= 0 && fd == coproc.read) {
data/posh-0.14.1/io.c:369:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		close(coproc.read);
data/posh-0.14.1/io.c:381:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (coproc.readw >= 0 && coproc.read >= 0 && fd == coproc.read) {
data/posh-0.14.1/io.c:381:60:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (coproc.readw >= 0 && coproc.read >= 0 && fd == coproc.read) {
data/posh-0.14.1/io.c:408:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	int fd = (mode & R_OK) ? coproc.read : coproc.write;
data/posh-0.14.1/io.c:425:43:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (!reuse || coproc.readw < 0 || coproc.read < 0) {
data/posh-0.14.1/io.c:426:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (coproc.read >= 0) {
data/posh-0.14.1/io.c:427:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			close(coproc.read);
data/posh-0.14.1/io.c:462: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(dir) + 3 + 20 + 20 + 1;
data/posh-0.14.1/jobs.c:1274:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			coproc_readw_close(coproc.read);
data/posh-0.14.1/jobs.c:1499: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(cp);
data/posh-0.14.1/ksh_dir.h:6:27:  [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).
# define NLENGTH(dirent)	(strlen(dirent->d_name))
data/posh-0.14.1/lex.c:1103: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).
			shf = shf_sopen((char *) 0, strlen(ps1) * 2,
data/posh-0.14.1/lex.c:1160: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).
			len = strlen(nbuf);
data/posh-0.14.1/main.c:202: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).
			len = strlen(simplified) + 1;
data/posh-0.14.1/main.c:729: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).
				    sizeof(struct temp) + strlen(tp->name) + 1,
data/posh-0.14.1/misc.c:51:42:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	return s ? strcpy((char*) alloc((size_t)strlen(s)+1, ap), s) : NULL;
data/posh-0.14.1/misc.c:67:9:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	return strncat(ns, s, n);
data/posh-0.14.1/misc.c:162:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				len = strlen(options[i].name);
data/posh-0.14.1/misc.c:262: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).
		p = cmd_opts + strlen(cmd_opts);
data/posh-0.14.1/misc.c:264: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).
		q = set_opts + strlen(set_opts);
data/posh-0.14.1/misc.c:395: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).
	se = s + strlen(s);
data/posh-0.14.1/misc.c:396: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).
	pe = p + strlen(p);
data/posh-0.14.1/misc.c:914:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		int len = strlen(src);
data/posh-0.14.1/misc.c:936:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((ret = read(fd, buf, nbytes)) < 0) {
data/posh-0.14.1/path.c:111: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).
			len = strlen(cwd);
data/posh-0.14.1/path.c:129:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen(file) + 1;
data/posh-0.14.1/path.c:235: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(p) + 1;
data/posh-0.14.1/sh.h:539:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	int	read;		/* pipe from co-process's stdout */
data/posh-0.14.1/shf.c:691: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).
	return shf_write(s, strlen(s), shf);
data/posh-0.14.1/shf.c:1126: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).
				tmp = strlen(p);
data/posh-0.14.1/shf.c:1180: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).
			len = strlen(s);
data/posh-0.14.1/src/builtins.c:1208:15:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
		old_umask = umask(0);
data/posh-0.14.1/src/builtins.c:1209:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
		umask(old_umask);
data/posh-0.14.1/src/builtins.c:1243:16:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			old_umask = umask(0);
data/posh-0.14.1/src/builtins.c:1244:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(old_umask); /* in case of error */
data/posh-0.14.1/src/builtins.c:1303:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
		umask(new_umask);
data/posh-0.14.1/table.c:27: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(n) + 1;
data/posh-0.14.1/table.c:43: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(n) + 1;
data/posh-0.14.1/var.c:367:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			    && s <= vq->val.s + strlen(vq->val.s))
data/posh-0.14.1/var.c:508: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).
	olen = strlen(s);
data/posh-0.14.1/var.c:527: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 namelen = strlen(vp->name);
data/posh-0.14.1/var.c:528: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).
	int vallen = strlen(val) + 1;
data/posh-0.14.1/var.c:1089: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).
		new = (struct tbl *)alloc(sizeof(struct tbl)+strlen(vp->name)+1, vp->areap);

ANALYSIS SUMMARY:

Hits = 188
Lines analyzed = 18960 in approximately 0.46 seconds (41260 lines/second)
Physical Source Lines of Code (SLOC) = 14634
Hits@level = [0]  14 [1]  68 [2]  78 [3]  20 [4]  18 [5]   4
Hits@level+ = [0+] 202 [1+] 188 [2+] 120 [3+]  42 [4+]  22 [5+]   4
Hits/KSLOC@level+ = [0+] 13.8035 [1+] 12.8468 [2+] 8.20008 [3+] 2.87003 [4+] 1.50335 [5+] 0.273336
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.