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/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c
Examining data/mew-beta-7.0.50~6.8+0.20200130/bin/mew.h
Examining data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c
Examining data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c
Examining data/mew-beta-7.0.50~6.8+0.20200130/bin/pattern.c
Examining data/mew-beta-7.0.50~6.8+0.20200130/bin/utils.c
Examining data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/config.h
Examining data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/dirent.c
Examining data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/dirent.h
Examining data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/w32.h

FINAL RESULTS:

data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:453:6:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	if (chmod(dst, sb.st_mode))
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:138:15:  [4] (misc) getlogin:
  It's often easy to fool getlogin. Sometimes it does not work at all,
  because some program messed up the utmp file. Often, it gives only the
  first 8 characters of the login name. The user currently logged in on the
  controlling tty of our program need not be the user who started it. Avoid
  getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid())
  and extract the desired information instead.
		if ((user = getlogin()) != NULL)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:179:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vfprintf(stderr, fmt, ap);
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:257:31:  [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 (!S_ISDIR(sb.st_mode) || access(newdir, R_OK|W_OK|X_OK))
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:263:32:  [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 (!S_ISDIR(sb.st_mode) || access(curdir, W_OK))
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:523:7:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
		if (access(inboxfile, F_OK) && errno == ENOENT)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:896:30:  [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 (!S_ISDIR(sb.st_mode) || access(InboxDir, W_OK))
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:797:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
		snprintf(Buf_filenm2, sizeof(Buf_filenm2), Suffix_fmt, "", *(Scan_ctx_buf + i));
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:806:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
		snprintf(Buf_filenm2, sizeof(Buf_filenm2), Suffix_fmt, "0", *(Scan_ctx_buf + i));
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:862:3:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		execvp(Exec_cmd, Argvec);
data/mew-beta-7.0.50~6.8+0.20200130/bin/utils.c:49:17:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                vfprintf(stderr, fmt, ap);
data/mew-beta-7.0.50~6.8+0.20200130/bin/utils.c:63:17:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                vfprintf(stderr, fmt, ap);
data/mew-beta-7.0.50~6.8+0.20200130/bin/utils.c:72:1:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
snprintf(char *buf, int len, const char *fmt, ...)
data/mew-beta-7.0.50~6.8+0.20200130/bin/utils.c:78:8:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
	ret = vsprintf(buf, fmt, ap);
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/dirent.c:68: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(dir->dir.d_name, wfd.cFileName);
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/w32.h:119:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define snprintf       _snprintf
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/w32.h:119:24:  [4] (format) _snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define snprintf       _snprintf
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/w32.h:121:9:  [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.
#define vsnprintf      _vsnprintf
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:159:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	if ((home = getenv("HOME")) != NULL)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:294:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	if ((mail = getenv("MAIL")) != NULL) {
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:214:15:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	char *home = getenv("HOME");
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/w32.h:128:7:  [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.
char *realpath(const char *, char*);
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:72: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	FileBuf[FBUFSIZ];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:73: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	Mbox[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:74: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	MboxLock[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:412:15:  [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 ((srcfd = open(src, O_RDONLY, 0)) < 0)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:416:15:  [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 ((dstfd = open(dst, O_EXCL | O_CREAT | O_WRONLY | O_TRUNC, 0)) < 0)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:515: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 num[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:533: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 num[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:544: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(inboxfile, flag, FileMode)) >= 0 ||
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:564: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 mailfile[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:565: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 inboxfile[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:566: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 backupfile[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:635:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	  if ((fd = open(lockfile, O_WRONLY | O_CREAT | O_EXCL, 0666)) < 0) {
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:641:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
				char buf[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:674: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 inboxfile[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:675: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 emptyline[3];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:693:15:  [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 ((srcfd = open(Mbox, oflag, 0)) < 0) {
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:738:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				bytes = atoi(&ln[i]);
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:816: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 inboxfile[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:851: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 mtimefile[PATH_MAX];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:879:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fp = fopen(mtimefile, FDWRITE)) == NULL)
data/mew-beta-7.0.50~6.8+0.20200130/bin/mew.h:123:17:  [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 FORK()	vfork()
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:909: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 Uu_read_buf[BUFSIZ];
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:910: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 Uu_flnm_buf[BUFSIZ];
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:1039:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			length = atoi(Optarg);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:93: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 Buf_header[MAX_HEADER];
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:94: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 Buf_filenm[MAX_FILE_NAME_LEN];
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:95: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 Buf_filenm2[MAX_FILE_NAME_LEN];
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:97: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 Current_folder[MAX_FILE_NAME_LEN];
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:99: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 *Argvec[MAX_ARGC];
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:749:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			*(Scan_ctx_buf + num) = atoi(fname);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:798:8:  [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).
		fp = fopen(Buf_filenm2, FDREAD);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:799:24:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if (fp == NULL) fp = fopen(Buf_filenm, FDREAD);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:807:8:  [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).
		fp = fopen(Buf_filenm2, FDREAD);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:808:24:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if (fp == NULL) fp = fopen(Buf_filenm, FDREAD);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:919:8:  [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).
		fp = fopen(*filename, FDREAD);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:926:9:  [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).
			fp = fopen(*filename, FDREAD);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:973:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		fr->num = atoi(range);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:975:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		fr->first = fr->last = atoi(range);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:979:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		fr->first = atoi(range);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:980:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		fr->last = atoi(last);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:1022:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			Body_len = atoi(Optarg);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:1043:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			Field_len = atoi(Optarg);
data/mew-beta-7.0.50~6.8+0.20200130/bin/pattern.c:106: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 Keyval[BUFSIZ];
data/mew-beta-7.0.50~6.8+0.20200130/bin/utils.c:19:26:  [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 memmove(d, s, n) bcopy((s), (d), (n))
data/mew-beta-7.0.50~6.8+0.20200130/bin/utils.c:90: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 tmp[BUFSIZ];
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/dirent.c:38:2:  [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(dir->dd_filename, "*.*");
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/dirent.h:24:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char          d_name[MAX_PATH + 1];
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/dirent.h:30:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char           dd_filename[MAX_PATH+1];
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:182:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(MboxLock) > 0)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:288:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strlen(home) + 9 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:295:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strlen(mail) + 1 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:304: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(mbox_path_list[i]) + strlen(user) + 1
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:304:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if (strlen(mbox_path_list[i]) + strlen(user) + 1
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:355: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).
	Suffix_len = strlen(Suffix);
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:418:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((rlen = read(srcfd, FileBuf, FBUFSIZ)) > 0) {
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:492: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(maildir) + strlen(MAILDIR_NEW) + 2;
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:492: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).
	int len = strlen(maildir) + strlen(MAILDIR_NEW) + 2;
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:494: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 (maildir == NULL || strlen(maildir) <= 0)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:520:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strlen(InboxDir) + strlen(num) + 2 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:520:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strlen(InboxDir) + strlen(num) + 2 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:541:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strlen(InboxDir) + strlen(num) + 2 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:541:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strlen(InboxDir) + strlen(num) + 2 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:547:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		usleep(rand() % 199);
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:576:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strlen(fromdir) + strlen(dp->d_name) + 2 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:576: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(fromdir) + strlen(dp->d_name) + 2 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:599:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strlen(fromdir) + strlen(list[i]) + 2 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:599: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(fromdir) + strlen(list[i]) + 2 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:604: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(backupdir) + strlen(list[i]) + 6 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:604: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).
			if (strlen(backupdir) + strlen(list[i]) + 6 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:667: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(lockfile) > 0)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:683: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(Mbox) + strlen(LOCK_SUFFIX) + 1 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:683:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(Mbox) + strlen(LOCK_SUFFIX) + 1 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:723: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(ln) < 3 &&
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:735:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				for (i = 14; i < strlen(ln); i++)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:762: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(ln) < 3 &&
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:773:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				bytes -= strlen(ln);
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:854: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(MEW_MTIME_PHRASE);
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:875: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(InboxDir) + strlen(MEW_MTIME_FILE) + 1 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:875: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(InboxDir) + strlen(MEW_MTIME_FILE) + 1 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:929:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if (strlen(Optarg) + 1 > PATH_MAX)
data/mew-beta-7.0.50~6.8+0.20200130/bin/incm.c:944: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).
			Suffix_len = strlen(Suffix);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mew.h:75:30:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
#define STRCPY(dst, src) do {strncpy(dst, src, sizeof(dst) - 1); dst[sizeof(dst) -1] = NUL;} while (0);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mew.h:116:11:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
#  define usleep(x) Sleep(x / 1000)
data/mew-beta-7.0.50~6.8+0.20200130/bin/mew.h:118:11:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
#  define usleep(x) poll(0, 0, (x)/1000)
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:174:7:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = getchar();
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:490:7:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = getchar();
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:757:14:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((c = getchar()) != EOF) {
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:867:14:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while((c1 = getchar()) != EOF) {
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:870:14:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ((c2 = getchar()) == EOF) {
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:876:15:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				if ((c3 = getchar()) == EOF) break;
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:885:14:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ((c3 = getchar()) == EOF) {
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:941: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 (((n + 2) / 3) != (strlen(Uu_read_buf) / 4))
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewencode.c:983:14:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((c = getchar()) != EOF)
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:27: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).
# define NAMLEN(dirent) strlen((dirent)->d_name)
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:411: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).
		Scan_ctx_slen[i]   = strlen(p);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:550: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).
	unsigned int len = strlen(s2);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:560: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).
	unsigned int len = strlen(key);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:631: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).
	unsigned int len = strlen(Key_field);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:831: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(Folders[0].folder) >= sizeof(Current_folder))
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:874: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(Folders[0].folder) >= sizeof(Current_folder))
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:893:16:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while ((c = getchar()) != LF && c != EOF) ;
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:898: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).
			p = p + strlen(CHDIR);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:900: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(p) >= sizeof(Current_folder))
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:945: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(Folders[0].folder) >= sizeof(Current_folder))
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:1081: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).
	Suffix_len = strlen(Suffix);
data/mew-beta-7.0.50~6.8+0.20200130/bin/mewl.c:1140:4:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			fgetc(sync);
data/mew-beta-7.0.50~6.8+0.20200130/bin/pattern.c:79: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).
	Plim = strlen(Pvec);
data/mew-beta-7.0.50~6.8+0.20200130/bin/utils.c:102: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).
		readlen = strlen(tmp);
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/dirent.c:27: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).
    size_t len = strlen(filename);
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/dirent.c:37: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).
    if (strlen(filename) == 0){
data/mew-beta-7.0.50~6.8+0.20200130/bin/w32/dirent.c:67: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).
    dir->dir.d_namlen = strlen(wfd.cFileName);

ANALYSIS SUMMARY:

Hits = 133
Lines analyzed = 4879 in approximately 0.13 seconds (36351 lines/second)
Physical Source Lines of Code (SLOC) = 3614
Hits@level = [0]  75 [1]  63 [2]  48 [3]   4 [4]  17 [5]   1
Hits@level+ = [0+] 208 [1+] 133 [2+]  70 [3+]  22 [4+]  18 [5+]   1
Hits/KSLOC@level+ = [0+] 57.554 [1+] 36.8013 [2+] 19.3691 [3+] 6.08744 [4+] 4.98063 [5+] 0.276702
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.