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/pm-utils-1.4.1/src/pm-pmu.c
Examining data/pm-utils-1.4.1/src/pm-reset-swap.c

FINAL RESULTS:

data/pm-utils-1.4.1/src/pm-pmu.c:86:17:  [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("/dev/pmu", W_OK)) {
data/pm-utils-1.4.1/src/pm-pmu.c:89:27:  [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/pmu", O_RDWR)) < 0) {
data/pm-utils-1.4.1/src/pm-reset-swap.c:90: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[11] = {0,};
data/pm-utils-1.4.1/src/pm-reset-swap.c:107: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[21] = {0,};
data/pm-utils-1.4.1/src/pm-reset-swap.c:140:17:  [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 (!(dev = fopen(argv[1], "r+b"))) {

ANALYSIS SUMMARY:

Hits = 5
Lines analyzed = 274 in approximately 0.03 seconds (8914 lines/second)
Physical Source Lines of Code (SLOC) = 152
Hits@level = [0]   7 [1]   0 [2]   4 [3]   0 [4]   1 [5]   0
Hits@level+ = [0+]  12 [1+]   5 [2+]   5 [3+]   1 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 78.9474 [1+] 32.8947 [2+] 32.8947 [3+] 6.57895 [4+] 6.57895 [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.