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/libqes-0.2.8/src/crc.c
Examining data/libqes-0.2.8/src/crc.h
Examining data/libqes-0.2.8/src/qes.h
Examining data/libqes-0.2.8/src/qes_compat.c
Examining data/libqes-0.2.8/src/qes_compat.h
Examining data/libqes-0.2.8/src/qes_file.c
Examining data/libqes-0.2.8/src/qes_file.h
Examining data/libqes-0.2.8/src/qes_libgnu.c
Examining data/libqes-0.2.8/src/qes_libgnu.h
Examining data/libqes-0.2.8/src/qes_log.c
Examining data/libqes-0.2.8/src/qes_log.h
Examining data/libqes-0.2.8/src/qes_match.c
Examining data/libqes-0.2.8/src/qes_match.h
Examining data/libqes-0.2.8/src/qes_seq.c
Examining data/libqes-0.2.8/src/qes_seq.h
Examining data/libqes-0.2.8/src/qes_seqfile.c
Examining data/libqes-0.2.8/src/qes_seqfile.h
Examining data/libqes-0.2.8/src/qes_sequtil.c
Examining data/libqes-0.2.8/src/qes_sequtil.h
Examining data/libqes-0.2.8/src/qes_str.c
Examining data/libqes-0.2.8/src/qes_str.h
Examining data/libqes-0.2.8/src/qes_util.c
Examining data/libqes-0.2.8/src/qes_util.h
Examining data/libqes-0.2.8/test/benchmarks.c
Examining data/libqes-0.2.8/test/helpers.c
Examining data/libqes-0.2.8/test/helpers.h
Examining data/libqes-0.2.8/test/kseq.h
Examining data/libqes-0.2.8/test/kseqcat.c
Examining data/libqes-0.2.8/test/logdemo.c
Examining data/libqes-0.2.8/test/qes_seqcat.c
Examining data/libqes-0.2.8/test/qes_seqprint.c
Examining data/libqes-0.2.8/test/test.c
Examining data/libqes-0.2.8/test/test_file.c
Examining data/libqes-0.2.8/test/test_helpers.c
Examining data/libqes-0.2.8/test/test_log.c
Examining data/libqes-0.2.8/test/test_match.c
Examining data/libqes-0.2.8/test/test_seq.c
Examining data/libqes-0.2.8/test/test_seqfile.c
Examining data/libqes-0.2.8/test/test_sequtil.c
Examining data/libqes-0.2.8/test/test_util.c
Examining data/libqes-0.2.8/test/testdata.c
Examining data/libqes-0.2.8/test/testdata.h
Examining data/libqes-0.2.8/test/tests.h
Examining data/libqes-0.2.8/test/tinytest/tinytest.c
Examining data/libqes-0.2.8/test/tinytest/tinytest.h
Examining data/libqes-0.2.8/test/tinytest/tinytest_macros.h

FINAL RESULTS:

data/libqes-0.2.8/src/qes_compat.c:53:13:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    count = vsnprintf(NULL, 0, format, args);
data/libqes-0.2.8/src/qes_compat.c:58:29:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        } else if ((count = vsnprintf(buffer, count + 1, format, copy)) < 0) {
data/libqes-0.2.8/src/qes_util.c:54:5:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    vsnprintf(msg_fmt, 1<<8, msg, args);
data/libqes-0.2.8/src/qes_util.c:70:5:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    vsnprintf(msg_fmt, 1<<8, msg, args);
data/libqes-0.2.8/test/helpers.c:66:9:  [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(buf, F_OK) == 0) {
data/libqes-0.2.8/test/test.c:70:9:  [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(data_prefix, W_OK | X_OK | R_OK) != 0) {
data/libqes-0.2.8/test/test_seqfile.c:84:15:  [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.
    tt_int_op(access(fname, F_OK), ==, 0);
data/libqes-0.2.8/test/test_seqfile.c:96:15:  [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.
    tt_int_op(access(fname, F_OK), ==, 0);
data/libqes-0.2.8/test/tinytest/tinytest_macros.h:44:2:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	printf args ;						\
data/libqes-0.2.8/test/benchmarks.c:215:19:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
    char *fname = tmpnam(NULL);
data/libqes-0.2.8/src/qes_file.c:322:9:  [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(nextbuf, file->bufiter, tocpy);
data/libqes-0.2.8/src/qes_file.c:364: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(nextbuf, file->bufiter, tocpy);
data/libqes-0.2.8/src/qes_file.c:459:9:  [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(nextbuf, file->bufiter, tocpy);
data/libqes-0.2.8/src/qes_file.c:483: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(nextbuf, file->bufiter, tocpy);
data/libqes-0.2.8/src/qes_str.h:111: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(str->str, cp, len);
data/libqes-0.2.8/src/qes_str.h:138: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(dest->str, src->str, src->capacity);
data/libqes-0.2.8/src/qes_str.h:149: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(dest->str + dest->len, src->str, src->len);
data/libqes-0.2.8/src/qes_util.c:48: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 msg_fmt[1<<8] = "";
data/libqes-0.2.8/src/qes_util.c:64: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 msg_fmt[1<<8] = "";
data/libqes-0.2.8/test/benchmarks.c:96: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[bsz];
data/libqes-0.2.8/test/benchmarks.c:118:18:  [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).
    FILE *file = fopen(infile, "r");
data/libqes-0.2.8/test/benchmarks.c:186: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 fp = open(infile, O_RDONLY);
data/libqes-0.2.8/test/benchmarks.c:281:16:  [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).
        rnds = atoi(argv[2]);
data/libqes-0.2.8/test/helpers.c:52: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[buflen];
data/libqes-0.2.8/test/helpers.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[buflen];
data/libqes-0.2.8/test/helpers.c:141: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 buffer[buflen];
data/libqes-0.2.8/test/helpers.c:143: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 crcbuf[9];
data/libqes-0.2.8/test/helpers.c:146:10:  [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).
    fp = fopen(filepath, "rb");
data/libqes-0.2.8/test/helpers.c:172:11:  [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).
    fp1 = fopen(file1, "r");
data/libqes-0.2.8/test/helpers.c:173:11:  [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).
    fp2 = fopen(file2, "r");
data/libqes-0.2.8/test/kseq.h:125: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(str->s + str->l, ks->buf + ks->begin, i - ks->begin); \
data/libqes-0.2.8/test/test_file.c:111: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 buffer[bufsize];
data/libqes-0.2.8/test/test_file.c:143: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 buffer[bufsize];
data/libqes-0.2.8/test/test_file.c:184: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 buffer[bufsize];
data/libqes-0.2.8/test/test_log.c:120: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).
    log_file = fopen(log_fname, "w");
data/libqes-0.2.8/test/test_seq.c:256:10:  [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).
    fp = fopen(outfile, "w");
data/libqes-0.2.8/test/test_seq.c:278:10:  [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).
    fp = fopen(outfile, "w");
data/libqes-0.2.8/test/test_seqfile.c:274: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 fp = open(fname, O_RDONLY);
data/libqes-0.2.8/test/test_seqfile.c:318: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).
    fp = open(fname, O_RDONLY);
data/libqes-0.2.8/test/test_util.c:39: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 *zeros[1<<10];
data/libqes-0.2.8/test/tinytest/tinytest.c:84:8:  [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 commandname[MAX_PATH+1];
data/libqes-0.2.8/test/tinytest/tinytest.c:134: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 buffer[LONGEST_TEST_NAME+256];
data/libqes-0.2.8/test/tinytest/tinytest.c:187:3:  [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 b[1];
data/libqes-0.2.8/test/tinytest/tinytest.c:202:3:  [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 b[1];
data/libqes-0.2.8/test/tinytest/tinytest.c:282: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 fullname[LONGEST_TEST_NAME];
data/libqes-0.2.8/src/qes_compat.c:38:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(dest, s, n);
data/libqes-0.2.8/src/qes_match.c:45:23:  [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).
        size_t len2 = strlen(seq2);
data/libqes-0.2.8/src/qes_match.c:46:15:  [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).
        len = strlen(seq1);
data/libqes-0.2.8/src/qes_match.c:77:23:  [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).
        size_t len2 = strlen(seq2);
data/libqes-0.2.8/src/qes_match.c:78:15:  [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).
        len = strlen(seq1);
data/libqes-0.2.8/src/qes_seq.c:133:15:  [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).
        len = strlen(header);
data/libqes-0.2.8/src/qes_seq.c:163:41:  [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).
    if (qes_seq_fill_name(seqobj, name, strlen(name)) != 0) return 1;
data/libqes-0.2.8/src/qes_seq.c:164:47:  [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).
    if (qes_seq_fill_comment(seqobj, comment, strlen(comment)) != 0) return 1;
data/libqes-0.2.8/src/qes_seq.c:165:39:  [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).
    if (qes_seq_fill_seq(seqobj, seq, strlen(seq)) != 0) return 1;
data/libqes-0.2.8/src/qes_seq.c:166:9:  [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).
    if (strlen(qual) > 0 &&
data/libqes-0.2.8/src/qes_seq.c:167:41:  [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).
        qes_seq_fill_qual(seqobj, qual, strlen(qual)) != 0) return 1;
data/libqes-0.2.8/src/qes_sequtil.c:237:21:  [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).
    size_t seqlen = strlen(seq);
data/libqes-0.2.8/src/qes_str.h:108:15:  [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).
        len = strlen(cp);
data/libqes-0.2.8/test/benchmarks.c:62:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
KSEQ_INIT(int, read)
data/libqes-0.2.8/test/helpers.c:69:16:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        return strncpy(ret, buf, buflen);
data/libqes-0.2.8/test/helpers.c:107:12:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    return strncpy(ret, buf, buflen);
data/libqes-0.2.8/test/kseqcat.c:15:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   KSEQ_INIT(int, read)
data/libqes-0.2.8/test/test_file.c:160:32:  [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).
        tt_int_op(res_len, ==, strlen(buffer));
data/libqes-0.2.8/test/test_file.c:338:19:  [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).
        tt_int_op(strlen(buf), ==, loremipsum_line_lens[line_num]);
data/libqes-0.2.8/test/test_file.c:361:19:  [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).
        tt_int_op(strlen(smallbuf), ==, loremipsum_line_lens[line_num]);
data/libqes-0.2.8/test/test_file.c:373:15:  [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).
    tt_int_op(strlen(buf), ==, 0);
data/libqes-0.2.8/test/test_file.c:386:15:  [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).
    tt_int_op(strlen(nulcp), ==, loremipsum_line_lens[line_num]);
data/libqes-0.2.8/test/test_seqfile.c:40:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   KSEQ_INIT(int, read)
data/libqes-0.2.8/test/tinytest/tinytest.c:206:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		r = (int)read(outcome_pipe[0], b, 1);

ANALYSIS SUMMARY:

Hits = 69
Lines analyzed = 7690 in approximately 0.28 seconds (27065 lines/second)
Physical Source Lines of Code (SLOC) = 5180
Hits@level = [0]  55 [1]  24 [2]  35 [3]   1 [4]   9 [5]   0
Hits@level+ = [0+] 124 [1+]  69 [2+]  45 [3+]  10 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 23.9382 [1+] 13.3205 [2+] 8.68726 [3+] 1.9305 [4+] 1.73745 [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.