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/mash-2.2.2+dfsg/src/mash/Command.cpp
Examining data/mash-2.2.2+dfsg/src/mash/Command.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandBounds.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandBounds.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandContain.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandContain.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandDistance.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandDistance.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandFind.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandFind.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandInfo.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandInfo.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandList.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandList.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandPaste.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandPaste.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandScreen.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandScreen.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandSketch.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandSketch.h
Examining data/mash-2.2.2+dfsg/src/mash/CommandTriangle.cpp
Examining data/mash-2.2.2+dfsg/src/mash/CommandTriangle.h
Examining data/mash-2.2.2+dfsg/src/mash/HashList.cpp
Examining data/mash-2.2.2+dfsg/src/mash/HashList.h
Examining data/mash-2.2.2+dfsg/src/mash/HashPriorityQueue.cpp
Examining data/mash-2.2.2+dfsg/src/mash/HashPriorityQueue.h
Examining data/mash-2.2.2+dfsg/src/mash/HashSet.cpp
Examining data/mash-2.2.2+dfsg/src/mash/HashSet.h
Examining data/mash-2.2.2+dfsg/src/mash/MinHashHeap.cpp
Examining data/mash-2.2.2+dfsg/src/mash/MinHashHeap.h
Examining data/mash-2.2.2+dfsg/src/mash/Sketch.h
Examining data/mash-2.2.2+dfsg/src/mash/ThreadPool.h
Examining data/mash-2.2.2+dfsg/src/mash/bloom_filter.hpp
Examining data/mash-2.2.2+dfsg/src/mash/hash.h
Examining data/mash-2.2.2+dfsg/src/mash/kseq.h
Examining data/mash-2.2.2+dfsg/src/mash/mash.cpp
Examining data/mash-2.2.2+dfsg/src/mash/memcpyLink.h
Examining data/mash-2.2.2+dfsg/src/mash/memcpyWrap.c
Examining data/mash-2.2.2+dfsg/src/mash/sketchParameterSetup.cpp
Examining data/mash-2.2.2+dfsg/src/mash/sketchParameterSetup.h
Examining data/mash-2.2.2+dfsg/src/mash/version.h
Examining data/mash-2.2.2+dfsg/src/mash/Sketch.cpp
Examining data/mash-2.2.2+dfsg/src/mash/hash.cpp

FINAL RESULTS:

data/mash-2.2.2+dfsg/src/mash/CommandFind.h:41:13:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
            strcpy(seq, seqNew);
data/mash-2.2.2+dfsg/src/mash/CommandPaste.cpp:79:6:  [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(out.c_str(), F_OK) != -1 )
data/mash-2.2.2+dfsg/src/mash/bloom_filter.hpp:513:10:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
         srand(static_cast<unsigned int>(random_seed_));
data/mash-2.2.2+dfsg/src/mash/CommandFind.cpp:127:24:  [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).
            inStream = fopen(arguments[i].c_str(), "r");
data/mash-2.2.2+dfsg/src/mash/CommandScreen.cpp:234:4:  [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(seqCopy, input.c_str(), input.length());
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:193:16:  [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).
				inStream = fopen(files[i].c_str(), "r");
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:257:14:  [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(file, O_RDONLY);
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:351:3:  [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(seqCopy, seq->seq.s, l);
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:385:14:  [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(file, O_CREAT | O_WRONLY | O_TRUNC, 0644);
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:907:14:  [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(file, O_RDONLY);
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:1357:14:  [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 in[CHUNK];
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:1358:14:  [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 out[CHUNK];
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:1413:14:  [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 in[CHUNK];
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:1414:14:  [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 out[CHUNK];
data/mash-2.2.2+dfsg/src/mash/Sketch.h:82:4:  [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(alphabet, other.alphabet, 256);
data/mash-2.2.2+dfsg/src/mash/bloom_filter.hpp:33:23:  [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 const unsigned char bit_mask[bits_per_char] = {
data/mash-2.2.2+dfsg/src/mash/hash.cpp:15: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 data[use64 ? 8 : 4];
data/mash-2.2.2+dfsg/src/mash/hash.cpp:22: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 data[16];
data/mash-2.2.2+dfsg/src/mash/kseq.h:123:13:  [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(str->s + str->l, ks->buf + ks->begin, i - ks->begin); \
data/mash-2.2.2+dfsg/src/mash/memcpyWrap.c:6:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  return memcpy(dest, src, n);
data/mash-2.2.2+dfsg/src/mash/CommandFind.h:40:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            seq = new char[strlen(seqNew) + 1];
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:1370:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        strm.avail_in = read(fdSource, in, CHUNK);
data/mash-2.2.2+dfsg/src/mash/Sketch.cpp:1428:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        strm.avail_in = read(fdSource, in, CHUNK);
data/mash-2.2.2+dfsg/src/mash/Sketch.h:21:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
static const int capnpHeaderLength = strlen(capnpHeader);
data/mash-2.2.2+dfsg/src/mash/bloom_filter.hpp:212:18:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
            std::equal(f.bit_table_,f.bit_table_ + raw_table_size_,bit_table_);

ANALYSIS SUMMARY:

Hits = 25
Lines analyzed = 7904 in approximately 0.22 seconds (35486 lines/second)
Physical Source Lines of Code (SLOC) = 5838
Hits@level = [0]   1 [1]   5 [2]  17 [3]   1 [4]   2 [5]   0
Hits@level+ = [0+]  26 [1+]  25 [2+]  20 [3+]   3 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 4.45358 [1+] 4.28229 [2+] 3.42583 [3+] 0.513875 [4+] 0.342583 [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.