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/dot-forward-0.71/dot-forward.c
Examining data/dot-forward-0.71/trycpp.c
Examining data/dot-forward-0.71/auto_qmail.h
Examining data/dot-forward-0.71/qmail.h
Examining data/dot-forward-0.71/qmail.c
Examining data/dot-forward-0.71/hier.c
Examining data/dot-forward-0.71/auto-str.c
Examining data/dot-forward-0.71/install.c
Examining data/dot-forward-0.71/instcheck.c
Examining data/dot-forward-0.71/sgetopt.h
Examining data/dot-forward-0.71/sgetopt.c
Examining data/dot-forward-0.71/subgetopt.h
Examining data/dot-forward-0.71/subgetopt.c
Examining data/dot-forward-0.71/substdio.h
Examining data/dot-forward-0.71/substdio.c
Examining data/dot-forward-0.71/substdi.c
Examining data/dot-forward-0.71/substdo.c
Examining data/dot-forward-0.71/substdio_copy.c
Examining data/dot-forward-0.71/subfd.h
Examining data/dot-forward-0.71/subfderr.c
Examining data/dot-forward-0.71/readwrite.h
Examining data/dot-forward-0.71/exit.h
Examining data/dot-forward-0.71/strerr.h
Examining data/dot-forward-0.71/strerr_sys.c
Examining data/dot-forward-0.71/strerr_die.c
Examining data/dot-forward-0.71/byte.h
Examining data/dot-forward-0.71/byte_chr.c
Examining data/dot-forward-0.71/byte_copy.c
Examining data/dot-forward-0.71/byte_cr.c
Examining data/dot-forward-0.71/str.h
Examining data/dot-forward-0.71/str_diffn.c
Examining data/dot-forward-0.71/str_len.c
Examining data/dot-forward-0.71/error.c
Examining data/dot-forward-0.71/error_str.c
Examining data/dot-forward-0.71/wait.h
Examining data/dot-forward-0.71/wait_pid.c
Examining data/dot-forward-0.71/trywaitp.c
Examining data/dot-forward-0.71/tryvfork.c
Examining data/dot-forward-0.71/fd.h
Examining data/dot-forward-0.71/fd_copy.c
Examining data/dot-forward-0.71/fd_move.c
Examining data/dot-forward-0.71/getln.h
Examining data/dot-forward-0.71/getln.c
Examining data/dot-forward-0.71/getln2.c
Examining data/dot-forward-0.71/gen_alloc.h
Examining data/dot-forward-0.71/gen_allocdefs.h
Examining data/dot-forward-0.71/stralloc.h
Examining data/dot-forward-0.71/stralloc_eady.c
Examining data/dot-forward-0.71/stralloc_pend.c
Examining data/dot-forward-0.71/stralloc_copy.c
Examining data/dot-forward-0.71/stralloc_opyb.c
Examining data/dot-forward-0.71/stralloc_opys.c
Examining data/dot-forward-0.71/stralloc_cat.c
Examining data/dot-forward-0.71/stralloc_catb.c
Examining data/dot-forward-0.71/stralloc_cats.c
Examining data/dot-forward-0.71/alloc.h
Examining data/dot-forward-0.71/alloc.c
Examining data/dot-forward-0.71/alloc_re.c
Examining data/dot-forward-0.71/env.h
Examining data/dot-forward-0.71/envread.c
Examining data/dot-forward-0.71/open.h
Examining data/dot-forward-0.71/open_read.c
Examining data/dot-forward-0.71/open_trunc.c
Examining data/dot-forward-0.71/sig.h
Examining data/dot-forward-0.71/sig_catch.c
Examining data/dot-forward-0.71/sig_pipe.c
Examining data/dot-forward-0.71/trysgact.c
Examining data/dot-forward-0.71/token822.h
Examining data/dot-forward-0.71/token822.c
Examining data/dot-forward-0.71/control.h
Examining data/dot-forward-0.71/control.c
Examining data/dot-forward-0.71/fmt.h
Examining data/dot-forward-0.71/fmt_ulong.c
Examining data/dot-forward-0.71/scan.h
Examining data/dot-forward-0.71/scan_ulong.c
Examining data/dot-forward-0.71/case.h
Examining data/dot-forward-0.71/case_diffb.c
Examining data/dot-forward-0.71/seek.h
Examining data/dot-forward-0.71/seek_set.c
Examining data/dot-forward-0.71/error.h

FINAL RESULTS:

data/dot-forward-0.71/install.c:23:7:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
  if (chown(home,uid,gid) == -1)
data/dot-forward-0.71/install.c:25:7:  [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(home,mode) == -1)
data/dot-forward-0.71/install.c:41:7:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
  if (chown(subdir,uid,gid) == -1)
data/dot-forward-0.71/install.c:43:7:  [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(subdir,mode) == -1)
data/dot-forward-0.71/install.c:96:7:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
  if (chown(file,uid,gid) == -1)
data/dot-forward-0.71/install.c:98:7:  [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(file,mode) == -1)
data/dot-forward-0.71/dot-forward.c:90:7:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      execv(*args,args);
data/dot-forward-0.71/qmail.c:32:7:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      execv(*binqqargs,binqqargs);
data/dot-forward-0.71/dot-forward.c:391:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((opt = getopt(argc,argv,"nN")) != opteof)
data/dot-forward-0.71/sgetopt.c:19:9:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
#define getopt sgetoptmine
data/dot-forward-0.71/sgetopt.c:28:5:  [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.
int getopt(argc,argv,opts)
data/dot-forward-0.71/sgetopt.h:5:9:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
#define getopt sgetoptmine
data/dot-forward-0.71/alloc.c:9: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.
typedef union { char irrelevant[ALIGNMENT]; double d; } aligned;
data/dot-forward-0.71/auto-str.c:5:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char buf1[256];
data/dot-forward-0.71/auto-str.c:21: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 octal[4];
data/dot-forward-0.71/control.c:11:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char inbuf[64];
data/dot-forward-0.71/dot-forward.c:53:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char messbuf[1024];
data/dot-forward-0.71/dot-forward.c:55:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char childbuf[1024];
data/dot-forward-0.71/dot-forward.c:70: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 *args[4];
data/dot-forward-0.71/dot-forward.c:303:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char strnum[FMT_ULONG];
data/dot-forward-0.71/dot-forward.c:312:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char qqbuf[256];
data/dot-forward-0.71/dot-forward.c:315:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char inbuf[256];
data/dot-forward-0.71/install.c:47:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char inbuf[SUBSTDIO_INSIZE];
data/dot-forward-0.71/install.c:48:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char outbuf[SUBSTDIO_OUTSIZE];
data/dot-forward-0.71/open_read.c:6:10:  [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).
{ return open(fn,O_RDONLY | O_NDELAY); }
data/dot-forward-0.71/open_trunc.c:6:10:  [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).
{ return open(fn,O_WRONLY | O_NDELAY | O_TRUNC | O_CREAT,0644); }
data/dot-forward-0.71/qmail.c:10:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char *binqqargs[2] = { "bin/qmail-queue", 0 } ;
data/dot-forward-0.71/qmail.c:21:20:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
  switch(qq->pid = vfork()) {
data/dot-forward-0.71/qmail.h:12:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[1024];
data/dot-forward-0.71/sgetopt.c:44:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char chp[2]; chp[0] = optproblem; chp[1] = '\n';
data/dot-forward-0.71/subfderr.c:5:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char subfd_errbuf[256];
data/dot-forward-0.71/tryvfork.c:3:3:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
  vfork();
data/dot-forward-0.71/control.c:63:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
 substdio_fdbuf(&ss,read,fd,inbuf,sizeof(inbuf));
data/dot-forward-0.71/control.c:115:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
 substdio_fdbuf(&ss,read,fd,inbuf,sizeof(inbuf));
data/dot-forward-0.71/dot-forward.c:96:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  substdio_fdbuf(&ssmess,read,0,messbuf,sizeof messbuf);
data/dot-forward-0.71/dot-forward.c:334:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  substdio_fdbuf(&ss,read,fd,inbuf,sizeof inbuf);
data/dot-forward-0.71/dot-forward.c:354:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      substdio_fdbuf(&ssmess,read,0,messbuf,sizeof messbuf);
data/dot-forward-0.71/install.c:69:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  substdio_fdbuf(&ssin,read,fdin,inbuf,sizeof inbuf);
data/dot-forward-0.71/install.c:108:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
  umask(077);
data/dot-forward-0.71/readwrite.h:4:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
extern int read();

ANALYSIS SUMMARY:

Hits = 40
Lines analyzed = 3277 in approximately 0.13 seconds (24757 lines/second)
Physical Source Lines of Code (SLOC) = 2840
Hits@level = [0]   2 [1]   8 [2]  20 [3]   4 [4]   2 [5]   6
Hits@level+ = [0+]  42 [1+]  40 [2+]  32 [3+]  12 [4+]   8 [5+]   6
Hits/KSLOC@level+ = [0+] 14.7887 [1+] 14.0845 [2+] 11.2676 [3+] 4.22535 [4+] 2.8169 [5+] 2.11268
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.