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/mailagent-3.1-106/agent/filter/dup2.c
Examining data/mailagent-3.1-106/agent/filter/environ.c
Examining data/mailagent-3.1-106/agent/filter/getopt.c
Examining data/mailagent-3.1-106/agent/filter/hash.c
Examining data/mailagent-3.1-106/agent/filter/hash.h
Examining data/mailagent-3.1-106/agent/filter/io.c
Examining data/mailagent-3.1-106/agent/filter/io.h
Examining data/mailagent-3.1-106/agent/filter/lock.c
Examining data/mailagent-3.1-106/agent/filter/lock.h
Examining data/mailagent-3.1-106/agent/filter/logfile.h
Examining data/mailagent-3.1-106/agent/filter/main.c
Examining data/mailagent-3.1-106/agent/filter/misc.c
Examining data/mailagent-3.1-106/agent/filter/msg.c
Examining data/mailagent-3.1-106/agent/filter/msg.h
Examining data/mailagent-3.1-106/agent/filter/parser.c
Examining data/mailagent-3.1-106/agent/filter/parser.h
Examining data/mailagent-3.1-106/agent/filter/portable.h
Examining data/mailagent-3.1-106/agent/filter/sysexits.h
Examining data/mailagent-3.1-106/agent/filter/user.c
Examining data/mailagent-3.1-106/agent/filter/environ.h
Examining data/mailagent-3.1-106/agent/filter/logfile.c
Examining data/mailagent-3.1-106/agent/pl/termios/termios_ph.c
Examining data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c
Examining data/mailagent-3.1-106/confmagic.h
Examining data/mailagent-3.1-106/patchlevel.h
Examining data/mailagent-3.1-106/revision.h

FINAL RESULTS:

data/mailagent-3.1-106/agent/filter/environ.c:141:2:  [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(env_line, value);
data/mailagent-3.1-106/agent/filter/environ.c:176:2:  [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(env_line, cval);
data/mailagent-3.1-106/agent/filter/environ.c:248:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(env_line, "%s=%s", key, value);		/* key=value */
data/mailagent-3.1-106/agent/filter/io.c:504:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(agentlock, "%s/%s", spool, AGENT_LOCK);
data/mailagent-3.1-106/agent/filter/io.c:548:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(fmt, "%s%s%s", "%s/", format, "%c");
data/mailagent-3.1-106/agent/filter/io.c:553:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(buf, fmt, dir, base, progpid + try, trailer);
data/mailagent-3.1-106/agent/filter/io.c:716:3:  [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(progpath, prog);
data/mailagent-3.1-106/agent/filter/io.c:721:13:  [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 (-1 == access(progpath, R_OK|X_OK)) {
data/mailagent-3.1-106/agent/filter/io.c:830:3:  [4] (shell) execle:
  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.
		execle(perl, "perl", mailagent, location, (char *) 0, envp);
data/mailagent-3.1-106/agent/filter/io.c:991:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(path, "%s/%s", spool, AGENT_WAIT);
data/mailagent-3.1-106/agent/filter/lock.c:101:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(lockfile, "%s/filter", dir);
data/mailagent-3.1-106/agent/filter/lock.c:135:24:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
#define lockname(b, p)	sprintf(b, "%s.lock", p)
data/mailagent-3.1-106/agent/filter/lock.c:137:24:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
#define lockname(b, p)	sprintf(b, "%s!", p)
data/mailagent-3.1-106/agent/filter/logfile.c:147:2:  [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(stdlog, buffer, arg1, arg2, arg3, arg4, arg5);
data/mailagent-3.1-106/agent/filter/logfile.c:250:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(where, "%s", strerror(errno));
data/mailagent-3.1-106/agent/filter/logfile.c:253:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(where, "%s", Strerror(errno));	/* Macro defined by Configure */
data/mailagent-3.1-106/agent/filter/logfile.c:278:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(where, "%s", sys_errnolist[errno]);
data/mailagent-3.1-106/agent/filter/misc.c:81: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, string);
data/mailagent-3.1-106/agent/filter/msg.c:70:2:  [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(stderr, msg, arg1, arg2, arg3, arg4, arg5);
data/mailagent-3.1-106/agent/filter/msg.c:84:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buffer, "ERROR %s", msg);
data/mailagent-3.1-106/agent/filter/msg.c:108:2:  [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(stderr, reason, arg1, arg2, arg3, arg4, arg5);
data/mailagent-3.1-106/agent/filter/msg.c:111:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer, "FATAL %s", reason);
data/mailagent-3.1-106/agent/filter/parser.c:193: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(path, home);
data/mailagent-3.1-106/agent/filter/parser.c:195:2:  [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(path, file);
data/mailagent-3.1-106/agent/filter/parser.c:196: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(mailagent, path);		/* Save configuration path for later */
data/mailagent-3.1-106/agent/filter/parser.c:244: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(path, home);
data/mailagent-3.1-106/agent/filter/parser.c:268: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(logfile, value);
data/mailagent-3.1-106/agent/filter/parser.c:272:2:  [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(logfile, value);
data/mailagent-3.1-106/agent/filter/parser.c:344:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buffer, "ERROR %s", reason);
data/mailagent-3.1-106/agent/filter/parser.c:388:12:  [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 (-1 != access(file, X_OK)) {			/* User may execute the file */
data/mailagent-3.1-106/agent/filter/parser.c:432: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(parent, home);		/* Prefill with home */
data/mailagent-3.1-106/agent/filter/parser.c:436:2:  [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(parent, file);			/* Append file to get an absolute path */
data/mailagent-3.1-106/agent/filter/parser.c:521:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(name, "p_%s", machine);		/* Name of field in ~/.mailagent */
data/mailagent-3.1-106/agent/filter/parser.c:560:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(buffer, "variable '%s' not defined in config file", name);
data/mailagent-3.1-106/agent/filter/parser.c:603: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(buffer, value);			/* Make a copy of original line */
data/mailagent-3.1-106/agent/filter/parser.c:795:7:  [4] (shell) popen:
  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.
	fd = popen(PHOSTNAME, "r");
data/mailagent-3.1-106/agent/filter/parser.c:799:3:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
		sscanf(buffer, "%s", name);
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:103:3:  [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(comment, padstr);
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:116:2:  [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(pack, buf);
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:123:3:  [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(comment, padstr);
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:126:3:  [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(pack, buf);
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:138:2:  [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(pack, buf);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:101:3:  [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(comment, padstr);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:114:2:  [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(pack, buf);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:121:3:  [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(comment, padstr);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:124:3:  [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(pack, buf);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:136:2:  [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(pack, buf);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:142:2:  [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(comment, padstr);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:145:2:  [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(pack, buf);
data/mailagent-3.1-106/agent/filter/getopt.c:82:12:  [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.
V_FUNC(int getopt, (nargc, nargv, ostr),
data/mailagent-3.1-106/agent/filter/main.c:137: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 ((c = getopt(argc, argv, "o:tV")) != EOF) {
data/mailagent-3.1-106/agent/filter/parser.c:170: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.
extern char *getenv();				/* Get environment variable */
data/mailagent-3.1-106/agent/filter/parser.c:474: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.
	home = getenv("HOME");		/* For tests only -- see main.c */
data/mailagent-3.1-106/agent/filter/environ.c:91: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 env_line[MAX_STRING + 1];	/* The environment line */
data/mailagent-3.1-106/agent/filter/environ.c:124: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 env_line[MAX_STRING + 1];	/* The environment line */
data/mailagent-3.1-106/agent/filter/environ.c:159: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 env_line[MAX_STRING + 1];	/* The environment line */
data/mailagent-3.1-106/agent/filter/environ.c:223: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 env_line[MAX_STRING + 1];	/* The environment line */
data/mailagent-3.1-106/agent/filter/hash.c:266:2:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	bcopy(&new_ht, ht, sizeof(struct htable));
data/mailagent-3.1-106/agent/filter/io.c:317:3:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		bcopy(buf, lp->arena + lp->offset, fit);
data/mailagent-3.1-106/agent/filter/io.c:380: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[BUFSIZE];
data/mailagent-3.1-106/agent/filter/io.c:493: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 agentlock[MAX_STRING];	/* Result */
data/mailagent-3.1-106/agent/filter/io.c:543: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 fmt[MAX_STRING];	/* Final sprintf() format string */
data/mailagent-3.1-106/agent/filter/io.c:570: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(buf, O_WRONLY | O_CREAT | O_EXCL, 0600);
data/mailagent-3.1-106/agent/filter/io.c:604: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 real[MAX_STRING];	/* Real queue mail */
data/mailagent-3.1-106/agent/filter/io.c:689: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 progpath[MAX_STRING + 1];
data/mailagent-3.1-106/agent/filter/io.c:822:8:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
	pid = vfork();			/* Virtual fork this time... */
data/mailagent-3.1-106/agent/filter/io.c:908: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 path[MAX_STRING];	/* Location of the AGENT_WAIT file */
data/mailagent-3.1-106/agent/filter/io.c:992:18:  [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 (-1 == (fd = open(path, O_WRONLY | O_APPEND | O_CREAT, 0600))) {
data/mailagent-3.1-106/agent/filter/io.c:1101: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 path[MAX_STRING];	/* Path name of created file */
data/mailagent-3.1-106/agent/filter/io.c:1232: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("/dev/tty", 2)) >= 0) {
data/mailagent-3.1-106/agent/filter/io.c:1298: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(filename, O_WRONLY | O_APPEND | (is_setid ? 0 : O_CREAT), 0600);
data/mailagent-3.1-106/agent/filter/lock.c:80: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.
private char lockfile[MAX_STRING];		/* Location of main filter lock file */
data/mailagent-3.1-106/agent/filter/lock.c:198: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[MAX_STRING];
data/mailagent-3.1-106/agent/filter/lock.c:205: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 (-1 != (fd = open(lockpath, O_CREAT | O_EXCL, 0)))
data/mailagent-3.1-106/agent/filter/lock.c:226: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[MAX_STRING];
data/mailagent-3.1-106/agent/filter/logfile.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 buffer[MAX_STRING];	/* Buffer which holds the expanded %m string */
data/mailagent-3.1-106/agent/filter/logfile.c:174: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(name, O_WRONLY | O_CREAT | O_APPEND, 0600);
data/mailagent-3.1-106/agent/filter/logfile.c:180: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).
	logfile = fopen(name, "a");		/* Append to existing file */
data/mailagent-3.1-106/agent/filter/logfile.c:255:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(where, "error #%d", errno);
data/mailagent-3.1-106/agent/filter/logfile.c:276:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(where, "UNKNOWN");
data/mailagent-3.1-106/agent/filter/logfile.c:280:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(where, "%d", errno);
data/mailagent-3.1-106/agent/filter/misc.c:91: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[20];				/* For unknown error codes */
data/mailagent-3.1-106/agent/filter/misc.c:105:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(buf, "%d", code);
data/mailagent-3.1-106/agent/filter/msg.c:83: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 buffer[MAX_STRING];
data/mailagent-3.1-106/agent/filter/msg.c:97: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 buffer[MAX_STRING];
data/mailagent-3.1-106/agent/filter/parser.c:182:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char path[MAX_STRING];			/* Full path of the config file */
data/mailagent-3.1-106/agent/filter/parser.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 mailagent[MAX_STRING];		/* Path of the configuration file */
data/mailagent-3.1-106/agent/filter/parser.c:198:7:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = fopen(path, "r");
data/mailagent-3.1-106/agent/filter/parser.c:246:2:  [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(path, ".forward");
data/mailagent-3.1-106/agent/filter/parser.c:263: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 logfile[MAX_STRING];		/* Location of logfile */
data/mailagent-3.1-106/agent/filter/parser.c:339: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 buffer[MAX_STRING];
data/mailagent-3.1-106/agent/filter/parser.c:363: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 parent[MAX_PATHLEN+1];	/* For parent directory */
data/mailagent-3.1-106/agent/filter/parser.c:506: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[MAX_STRING];				/* Built 'p_host' */
data/mailagent-3.1-106/agent/filter/parser.c:552: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 buffer[MAX_STRING];
data/mailagent-3.1-106/agent/filter/parser.c:600: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 buffer[MAX_STRING];		/* Copy on which we work */
data/mailagent-3.1-106/agent/filter/parser.c:648: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 buffer[MAX_STRING];	/* To hold the name of the variable */
data/mailagent-3.1-106/agent/filter/parser.c:686: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[MAX_STRING];				/* The name of the variable */
data/mailagent-3.1-106/agent/filter/parser.c:766: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[MAX_STRING + 1];		/* The host name */
data/mailagent-3.1-106/agent/filter/parser.c:774: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[MAX_STRING + 1];		/* The host name read from command */
data/mailagent-3.1-106/agent/filter/parser.c:775: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 buffer[MAX_STRING + 1];	/* Input buffer */
data/mailagent-3.1-106/agent/filter/parser.c:819: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[MAX_STRING + 1];		/* Constructed name */
data/mailagent-3.1-106/agent/filter/user.c:55: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 login[LOGIN_LEN + 1];	/* Where login name is stored */
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:69:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(comment, "ws_row "); \
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:70:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(buf, "%c", 'S'); \
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:71:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(fields, "'row', ");	\
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:75:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(comment, "ws_col "); \
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:76:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(buf, "%c", 'S'); \
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:77:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(fields, "'col', "); \
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:84: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 comment[MAX_LEN];
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:85: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 pack[MAX_LEN];
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:86: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 fields[MAX_LEN];
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:87:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[MAX_LEN];
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:104:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(pack, "x%d", last_off);
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:105:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(fields, "'pad', ");
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:124:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(fields, "'pad', ");
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:125:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(buf, "x%d", offset);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:68:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(comment, "ut_name[] "); \
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:69:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(buf, "A%d", user_len); \
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:70:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(fields, "'user', ");	\
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:74:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(comment, "ut_line[] "); \
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:75:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(buf, "A%d", line_len); \
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:76:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(fields, "'line', "); \
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:82: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 comment[MAX_LEN];
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:83: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 pack[MAX_LEN];
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:84: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 fields[MAX_LEN];
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:85:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[MAX_LEN];
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:102:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(pack, "x%d", last_off);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:103:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(fields, "'pad', ");
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:122:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(fields, "'pad', ");
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:123:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(buf, "x%d", offset);
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:143:2:  [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(fields, "'pad')");
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:144:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(buf, "x%d", offset);
data/mailagent-3.1-106/confmagic.h:16:9:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#ifndef bcopy
data/mailagent-3.1-106/confmagic.h:17:9:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define bcopy(s,d,l) memcpy((d),(s),(l))
data/mailagent-3.1-106/confmagic.h:17:22:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define bcopy(s,d,l) memcpy((d),(s),(l))
data/mailagent-3.1-106/confmagic.h:34:9:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
#define vfork fork
data/mailagent-3.1-106/agent/filter/environ.c:99:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(env_line, env, MAX_STRING);
data/mailagent-3.1-106/agent/filter/environ.c:136:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(env_line, cval, MAX_STRING);
data/mailagent-3.1-106/agent/filter/environ.c:137:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(env_line) + strlen(value) > MAX_STRING) {
data/mailagent-3.1-106/agent/filter/environ.c:137:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(env_line) + strlen(value) > MAX_STRING) {
data/mailagent-3.1-106/agent/filter/environ.c:171:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(env_line, value, MAX_STRING);
data/mailagent-3.1-106/agent/filter/environ.c:172:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(env_line) + strlen(cval) > MAX_STRING) {
data/mailagent-3.1-106/agent/filter/environ.c:172:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(env_line) + strlen(cval) > MAX_STRING) {
data/mailagent-3.1-106/agent/filter/environ.c:244: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(key) + strlen(value) + 1) > MAX_STRING) {
data/mailagent-3.1-106/agent/filter/environ.c:244: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).
		if ((strlen(key) + strlen(value) + 1) > MAX_STRING) {
data/mailagent-3.1-106/agent/filter/io.c:389:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((n = read(0, buf, BUFSIZE))) {
data/mailagent-3.1-106/agent/filter/io.c:408:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	(void) umask(077);					/* Files we create are private ones */
data/mailagent-3.1-106/agent/filter/io.c:694: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 proglen = strlen(prog);
data/mailagent-3.1-106/agent/filter/io.c:705: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).
			(int) strlen(cp);				/* Slurp remaining if not found */
data/mailagent-3.1-106/agent/filter/io.c:711:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(progpath, cp, len);		/* Will not add trailing '\0' */
data/mailagent-3.1-106/agent/filter/io.c:714:4:  [1] (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 character.
			strcpy(progpath, ".");			/* Good old "null" path field */
data/mailagent-3.1-106/agent/filter/io.c:715:3:  [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(progpath, "/");
data/mailagent-3.1-106/agent/filter/io.c:1014: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).
	size = strlen(where);
data/mailagent-3.1-106/agent/filter/io.c:1332: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).
			write(stdfd, msg, strlen(msg));		/* They might see this */
data/mailagent-3.1-106/agent/filter/logfile.c:259: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).
	return strlen(where);
data/mailagent-3.1-106/agent/filter/logfile.c:283: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).
	return strlen(where);
data/mailagent-3.1-106/agent/filter/misc.c:76: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).
	char *new = malloc(strlen(string) + 1);		/* +1 for \0 */
data/mailagent-3.1-106/agent/filter/parser.c:194:2:  [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(path, "/");
data/mailagent-3.1-106/agent/filter/parser.c:245:2:  [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(path, "/");
data/mailagent-3.1-106/agent/filter/parser.c:269:2:  [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(logfile, "/");						/* Logging directory */
data/mailagent-3.1-106/agent/filter/parser.c:433:3:  [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(parent, "/");
data/mailagent-3.1-106/agent/filter/parser.c:627:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(home) == 0)		/* As a special case, this is empty when */
data/mailagent-3.1-106/agent/filter/parser.c:719: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).
	path[strlen(path) - 1] = '\0';			/* Chop final newline */
data/mailagent-3.1-106/agent/filter/user.c:62:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(login, pw->pw_name, LOGIN_LEN);
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:97:2:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
	sprintf(fields, "(");
data/mailagent-3.1-106/agent/pl/termios/termios_ph.c:140:2:  [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(fields, ")");
data/mailagent-3.1-106/agent/pl/utmp/utmp_ph.c:95:2:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
	sprintf(fields, "(");

ANALYSIS SUMMARY:

Hits = 167
Lines analyzed = 5055 in approximately 0.17 seconds (30143 lines/second)
Physical Source Lines of Code (SLOC) = 2871
Hits@level = [0]  14 [1]  31 [2]  83 [3]   4 [4]  49 [5]   0
Hits@level+ = [0+] 181 [1+] 167 [2+] 136 [3+]  53 [4+]  49 [5+]   0
Hits/KSLOC@level+ = [0+] 63.0442 [1+] 58.1679 [2+] 47.3703 [3+] 18.4605 [4+] 17.0672 [5+]   0
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.