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/fatrace-0.16/fatrace.c

FINAL RESULTS:

data/fatrace-0.16/fatrace.c:285:23:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
        ssize_t len = readlink (printbuf, pathname, sizeof (pathname));
data/fatrace-0.16/fatrace.c:375:42:  [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 (mount->mnt_fsname == NULL || access (mount->mnt_fsname, F_OK) != 0 ||
data/fatrace-0.16/fatrace.c:440:13:  [3] (buffer) getopt_long:
  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.
        c = getopt_long (argc, argv, "C:co:s:tp:f:h", long_options, NULL);
data/fatrace-0.16/fatrace.c:104: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).
    fd = open (mount_point, O_RDONLY | O_NOFOLLOW);
data/fatrace-0.16/fatrace.c:116:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy (&fsids[fsids_len].fsid, &s.f_fsid, sizeof (s.f_fsid));
data/fatrace-0.16/fatrace.c:175:12:  [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 buffer[10];
data/fatrace-0.16/fatrace.c:230:12:  [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 printbuf[100];
data/fatrace-0.16/fatrace.c:231:12:  [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 procname[100];
data/fatrace-0.16/fatrace.c:233:12:  [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 pathname[PATH_MAX];
data/fatrace-0.16/fatrace.c:242: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).
    proc_fd = open (printbuf, O_RDONLY);
data/fatrace-0.16/fatrace.c:589: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).
        int fd = open (option_output, O_CREAT|O_WRONLY|O_EXCL, 0666);
data/fatrace-0.16/fatrace.c:244:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t len = read (proc_fd, procname, sizeof (procname));
data/fatrace-0.16/fatrace.c:621:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        res = read (fan_fd, buffer, BUFSIZE);

ANALYSIS SUMMARY:

Hits = 13
Lines analyzed = 649 in approximately 0.19 seconds (3479 lines/second)
Physical Source Lines of Code (SLOC) = 467
Hits@level = [0]   9 [1]   2 [2]   8 [3]   1 [4]   1 [5]   1
Hits@level+ = [0+]  22 [1+]  13 [2+]  11 [3+]   3 [4+]   2 [5+]   1
Hits/KSLOC@level+ = [0+] 47.1092 [1+] 27.8373 [2+] 23.5546 [3+] 6.42398 [4+] 4.28266 [5+] 2.14133
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.