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/mtdev-1.1.6/include/mtdev-plumbing.h
Examining data/mtdev-1.1.6/include/mtdev-mapping.h
Examining data/mtdev-1.1.6/include/mtdev.h
Examining data/mtdev-1.1.6/src/common.h
Examining data/mtdev-1.1.6/src/state.h
Examining data/mtdev-1.1.6/src/iobuf.c
Examining data/mtdev-1.1.6/src/evbuf.h
Examining data/mtdev-1.1.6/src/match_four.c
Examining data/mtdev-1.1.6/src/iobuf.h
Examining data/mtdev-1.1.6/src/caps.c
Examining data/mtdev-1.1.6/src/match.c
Examining data/mtdev-1.1.6/src/core.c
Examining data/mtdev-1.1.6/src/match.h
Examining data/mtdev-1.1.6/test/mtdev-matching.c
Examining data/mtdev-1.1.6/test/mtdev-kernel.c
Examining data/mtdev-1.1.6/test/mtdev-mapgen.c
Examining data/mtdev-1.1.6/test/mtdev-test.c

FINAL RESULTS:

data/mtdev-1.1.6/src/iobuf.c:58:2:  [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(ev, buf->data + buf->tail, EVENT_SIZE);
data/mtdev-1.1.6/src/iobuf.h:39:2:  [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 data[DIM_BUFFER];
data/mtdev-1.1.6/src/match.c:294:2:  [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(nmstar, mstar, sizeof(mat_t));
data/mtdev-1.1.6/src/match.c:327:2:  [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(mstar, nmstar, sizeof(mat_t));
data/mtdev-1.1.6/test/mtdev-kernel.c:131:10:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	eslot = atoi(argv[1]) + 1;
data/mtdev-1.1.6/test/mtdev-test.c:113:7:  [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(argv[1], O_RDONLY | O_NONBLOCK);
data/mtdev-1.1.6/src/iobuf.c:50:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		SYSCALL(n = read(fd, buf->data + buf->head,

ANALYSIS SUMMARY:

Hits = 7
Lines analyzed = 2661 in approximately 0.11 seconds (23876 lines/second)
Physical Source Lines of Code (SLOC) = 1568
Hits@level = [0]  40 [1]   1 [2]   6 [3]   0 [4]   0 [5]   0
Hits@level+ = [0+]  47 [1+]   7 [2+]   6 [3+]   0 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 29.9745 [1+] 4.46429 [2+] 3.82653 [3+]   0 [4+]   0 [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.