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/cramfsswap-1.4.1/cramfsswap.c

FINAL RESULTS:

data/cramfsswap-1.4.1/cramfsswap.c:38: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.
  unsigned char		buffer[BUFFERSIZE], is_hostorder, host_is_le, file_is_le;
data/cramfsswap-1.4.1/cramfsswap.c:49:16:  [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 ( (infile=open(argv[1],O_RDONLY)) < 0 )
data/cramfsswap-1.4.1/cramfsswap.c:54:17:  [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 ( (outfile=open(argv[2], O_RDWR|O_TRUNC|O_CREAT, 0644)) < 0 )
data/cramfsswap-1.4.1/cramfsswap.c:234:7:  [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(&inode, &inode_in, sizeof(inode_in));
data/cramfsswap-1.4.1/cramfsswap.c:238:7:  [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(&inode, &inode_out, sizeof(inode_in));
data/cramfsswap-1.4.1/cramfsswap.c:60:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if ( read(infile, &superblock_in, sizeof(superblock_in)) != sizeof(superblock_in) )
data/cramfsswap-1.4.1/cramfsswap.c:180:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ( read(infile, &inode_in, sizeof(inode_in)) != sizeof(inode_in) )
data/cramfsswap-1.4.1/cramfsswap.c:245:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ( read(infile, &buffer, inode.namelen<<2) != inode.namelen<<2 )
data/cramfsswap-1.4.1/cramfsswap.c:295:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ( read(infile, &blockpointer_in, 4) != 4 )
data/cramfsswap-1.4.1/cramfsswap.c:323:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ( read(infile, &buffer, readbytes) != readbytes )
data/cramfsswap-1.4.1/cramfsswap.c:340:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    readbytes = read(infile, &buffer, BUFFERSIZE);

ANALYSIS SUMMARY:

Hits = 11
Lines analyzed = 365 in approximately 0.05 seconds (6647 lines/second)
Physical Source Lines of Code (SLOC) = 252
Hits@level = [0]  11 [1]   6 [2]   5 [3]   0 [4]   0 [5]   0
Hits@level+ = [0+]  22 [1+]  11 [2+]   5 [3+]   0 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 87.3016 [1+] 43.6508 [2+] 19.8413 [3+]   0 [4+]   0 [5+]   0
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.