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/extsmail-2.4/common.c
Examining data/extsmail-2.4/common.h
Examining data/extsmail-2.4/compat/strtonum.c
Examining data/extsmail-2.4/compat/strtonum.h
Examining data/extsmail-2.4/conf.h
Examining data/extsmail-2.4/externals.h
Examining data/extsmail-2.4/extsmail.c
Examining data/extsmail-2.4/extsmaild.c

FINAL RESULTS:

data/extsmail-2.4/extsmail.c:96:38:  [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.
#   define SPOOL_WRITE(fmt, ...) if (fprintf(sf, fmt, __VA_ARGS__) == -1) \
data/extsmail-2.4/extsmaild.c:1186:13:  [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(cur_ext->sendmail_argv[0], (char **const) sub_argv);
data/extsmail-2.4/extsmaild.c:1364:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if (system(cmd) != 0)
data/extsmail-2.4/extsmaild.c:1383:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if (system(cmd) != 0)
data/extsmail-2.4/extsmaild.c:1522:18:  [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 ((ch = getopt(argc, argv, "hm:t:v")) != -1) {
data/extsmail-2.4/common.c:114:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    yycin = fopen(cnd_path, "rt");
data/extsmail-2.4/common.c:226: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 tmpbuf[TMPBUFLEN];
data/extsmail-2.4/common.c:260:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(line + line_len, tmpbuf, i);
data/extsmail-2.4/extsmail.c:70:16:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    if ((sfd = mkstemp(sp)) == -1)
data/extsmail-2.4/extsmail.c:112: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[BUF_SIZE];
data/extsmail-2.4/extsmaild.c:155:21:  [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 (((lock_fd = open(lock_path, O_CREAT | O_RDWR, 0600)) == -1)
data/extsmail-2.4/extsmaild.c:333:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    yyein = fopen(cnd_path, "rt");
data/extsmail-2.4/extsmaild.c:518:22:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
            int fd = open(msg_path, O_RDONLY);
data/extsmail-2.4/extsmaild.c:769:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dhd_buf + dhd_buf_len, line, line_len);
data/extsmail-2.4/extsmaild.c:1180:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(sub_argv, cur_ext->sendmail_argv,
data/extsmail-2.4/extsmaild.c:1182:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(sub_argv + cur_ext->sendmail_nargv, argv,
data/extsmail-2.4/extsmaild.c:1601: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).
        int smf = open(msgs_path, O_RDONLY);
data/extsmail-2.4/extsmaild.c:1689:17:  [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[INOTIFY_BUFLEN];
data/extsmail-2.4/common.c:232:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t nr = read(fd, &tmpbuf, TMPBUFLEN);
data/extsmail-2.4/common.c:293:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strncmp(path, HOME_PFX, strlen(HOME_PFX)) == 0) {
data/extsmail-2.4/common.c:298:75:  [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 (asprintf(&exp_path, "%s%s%s", pw_ent->pw_dir, DIR_SEP, path + strlen(HOME_PFX)) == -1)
data/extsmail-2.4/common.c:311: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).
    char *buf = malloc(strlen(str) + 1);
data/extsmail-2.4/common.c:315:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    memmove(buf, str, strlen(str) + 1);
data/extsmail-2.4/common.c:325: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).
    while (i < strlen(str)) {
data/extsmail-2.4/common.c:326: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).
        if (i < strlen(str) - strlen(old)
data/extsmail-2.4/common.c:326:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (i < strlen(str) - strlen(old)
data/extsmail-2.4/common.c:327:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          && memcmp(str + i, old, strlen(old)) == 0) {
data/extsmail-2.4/common.c:328: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).
            i += strlen(old);
data/extsmail-2.4/common.c:329: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).
            new_size += strlen(new);
data/extsmail-2.4/common.c:342: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).
    while (i < strlen(str)) {
data/extsmail-2.4/common.c:343: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).
        if (i < strlen(str) - strlen(old)
data/extsmail-2.4/common.c:343:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (i < strlen(str) - strlen(old)
data/extsmail-2.4/common.c:344:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          && memcmp(str + i, old, strlen(old)) == 0) {
data/extsmail-2.4/common.c:345:39:  [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).
            memmove(new_str + j, new, strlen(new));
data/extsmail-2.4/common.c:346: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).
            i += strlen(old);
data/extsmail-2.4/common.c:347: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).
            j += strlen(new);
data/extsmail-2.4/extsmail.c:68:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(S_IRWXG | S_IRWXO | S_IXUSR);
data/extsmail-2.4/extsmail.c:108:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        SPOOL_WRITE("%zd\n%s\n", strlen(argv[i]), argv[i]);
data/extsmail-2.4/extsmaild.c:697:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t nr = read(fd, arg, sa + 1);
data/extsmail-2.4/extsmaild.c:745: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).
        ssize_t line_len = strlen(line);
data/extsmail-2.4/extsmaild.c:931:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            ssize_t nr = read(fd, fdbuf, fdbuf_alloc);
data/extsmail-2.4/extsmaild.c:984:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            ssize_t nr = read(cstderr_fd, stderrbuf + stderrbuf_used,
data/extsmail-2.4/extsmaild.c:1690:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                int res = read(fd, buf, INOTIFY_BUFLEN);

ANALYSIS SUMMARY:

Hits = 43
Lines analyzed = 2420 in approximately 0.08 seconds (28907 lines/second)
Physical Source Lines of Code (SLOC) = 1475
Hits@level = [0]  71 [1]  25 [2]  13 [3]   1 [4]   4 [5]   0
Hits@level+ = [0+] 114 [1+]  43 [2+]  18 [3+]   5 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 77.2881 [1+] 29.1525 [2+] 12.2034 [3+] 3.38983 [4+] 2.71186 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.