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/zchunk-1.1.7+ds1/src/lib/buzhash/buzhash.c
Examining data/zchunk-1.1.7+ds1/src/lib/buzhash/buzhash.h
Examining data/zchunk-1.1.7+ds1/src/lib/comp/comp.c
Examining data/zchunk-1.1.7+ds1/src/lib/comp/nocomp/nocomp.c
Examining data/zchunk-1.1.7+ds1/src/lib/comp/nocomp/nocomp.h
Examining data/zchunk-1.1.7+ds1/src/lib/comp/zstd/zstd.c
Examining data/zchunk-1.1.7+ds1/src/lib/comp/zstd/zstd.h
Examining data/zchunk-1.1.7+ds1/src/lib/compint.c
Examining data/zchunk-1.1.7+ds1/src/lib/dl/dl.c
Examining data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c
Examining data/zchunk-1.1.7+ds1/src/lib/dl/range.c
Examining data/zchunk-1.1.7+ds1/src/lib/error.c
Examining data/zchunk-1.1.7+ds1/src/lib/hash/hash.c
Examining data/zchunk-1.1.7+ds1/src/lib/hash/sha1/sha1.c
Examining data/zchunk-1.1.7+ds1/src/lib/hash/sha1/sha1.h
Examining data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c
Examining data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.h
Examining data/zchunk-1.1.7+ds1/src/lib/header.c
Examining data/zchunk-1.1.7+ds1/src/lib/index/index_common.c
Examining data/zchunk-1.1.7+ds1/src/lib/index/index_create.c
Examining data/zchunk-1.1.7+ds1/src/lib/index/index_read.c
Examining data/zchunk-1.1.7+ds1/src/lib/io.c
Examining data/zchunk-1.1.7+ds1/src/lib/log.c
Examining data/zchunk-1.1.7+ds1/src/lib/uthash.h
Examining data/zchunk-1.1.7+ds1/src/lib/zck.c
Examining data/zchunk-1.1.7+ds1/src/lib/zck_private.h
Examining data/zchunk-1.1.7+ds1/src/memmem.c
Examining data/zchunk-1.1.7+ds1/src/memmem.h
Examining data/zchunk-1.1.7+ds1/src/unzck.c
Examining data/zchunk-1.1.7+ds1/src/util_common.c
Examining data/zchunk-1.1.7+ds1/src/util_common.h
Examining data/zchunk-1.1.7+ds1/src/zck.c
Examining data/zchunk-1.1.7+ds1/src/zck_delta_size.c
Examining data/zchunk-1.1.7+ds1/src/zck_dl.c
Examining data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c
Examining data/zchunk-1.1.7+ds1/src/zck_read_header.c
Examining data/zchunk-1.1.7+ds1/test/copy_chunks.c
Examining data/zchunk-1.1.7+ds1/test/empty.c
Examining data/zchunk-1.1.7+ds1/test/invalid_input_checksum.c
Examining data/zchunk-1.1.7+ds1/test/lib/util.c
Examining data/zchunk-1.1.7+ds1/test/lib/util.h
Examining data/zchunk-1.1.7+ds1/test/optelems.c
Examining data/zchunk-1.1.7+ds1/test/read_single_chunk.c
Examining data/zchunk-1.1.7+ds1/test/read_single_comp_chunk.c
Examining data/zchunk-1.1.7+ds1/test/shacheck.c
Examining data/zchunk-1.1.7+ds1/debian/tests/chunk.c

FINAL RESULTS:

data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:44:8:  [4] (format) snprintf:
  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.
    if(snprintf(regex_b, strlen(regex) + strlen(boundary), regex,
data/zchunk-1.1.7+ds1/src/lib/error.c:53:12:  [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.
    size = vsnprintf(NULL, 0, format, args);
data/zchunk-1.1.7+ds1/src/lib/error.c:69: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(zck->msg, size + 1, format, args);
data/zchunk-1.1.7+ds1/src/lib/uthash.h:522:29:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)
data/zchunk-1.1.7+ds1/src/util_common.c:35:5:  [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(ZCK_NAME " " ZCK_VERSION "\nCopyright (c) " ZCK_COPYRIGHT_YEAR
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:254:9:  [4] (shell) execl:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        execl("/usr/bin/zstd", "zstd", "--train", dir, "-r", "-o", out_name, NULL);
data/zchunk-1.1.7+ds1/test/copy_chunks.c:45:5:  [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(path, argv[1]);
data/zchunk-1.1.7+ds1/test/shacheck.c:75:9:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        execv(cmd, args);
data/zchunk-1.1.7+ds1/src/lib/zck.c:137:20:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    char *tmpdir = getenv("TMPDIR");
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:119:24:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        char *tmpdir = getenv("TMPDIR");
data/zchunk-1.1.7+ds1/debian/tests/chunk.c:52:21:  [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).
	const int src_fd = open(src_name, O_RDONLY);
data/zchunk-1.1.7+ds1/debian/tests/chunk.c:91:21:  [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).
	const int dst_fd = open(dst_name, O_WRONLY | O_CREAT, 0644);
data/zchunk-1.1.7+ds1/src/lib/comp/comp.c:104: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(dst, comp->dc_data+comp->dc_data_loc, dl_size);
data/zchunk-1.1.7+ds1/src/lib/comp/comp.c:121: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(comp->data + comp->data_size, src, src_size);
data/zchunk-1.1.7+ds1/src/lib/comp/comp.c:400: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(temp, comp->dc_data + comp->dc_data_loc,
data/zchunk-1.1.7+ds1/src/lib/comp/comp.c:408: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(comp->dc_data + comp->dc_data_size, src, src_size);
data/zchunk-1.1.7+ds1/src/lib/comp/nocomp/nocomp.c:53: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(*dst, src, src_size);
data/zchunk-1.1.7+ds1/src/lib/comp/zstd/zstd.c:97: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(comp->dc_data + comp->dc_data_size, src, src_size);
data/zchunk-1.1.7+ds1/src/lib/dl/dl.c:63: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[BUF_SIZE] = {0};
data/zchunk-1.1.7+ds1/src/lib/dl/dl.c:125: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.
    static char buf[BUF_SIZE] = {0};
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:119: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(buf + mp->buffer_len, b, l);
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:163:17:  [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(mp->buffer, header_start, size);
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:233: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(buf, b, size);
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:248: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(boundary, boundary_start, boundary_length);
data/zchunk-1.1.7+ds1/src/lib/hash/hash.c:78: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[BUF_SIZE] = {0};
data/zchunk-1.1.7+ds1/src/lib/hash/hash.c:445: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[BUF_SIZE] = {0};
data/zchunk-1.1.7+ds1/src/lib/hash/sha1/sha1.c:62: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(block, buffer, 64);
data/zchunk-1.1.7+ds1/src/lib/hash/sha1/sha1.c:119: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(&context->buffer[j], data, (i = 64-j));
data/zchunk-1.1.7+ds1/src/lib/hash/sha1/sha1.c:127: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(&context->buffer[j], &data[i], len - i);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.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(&ctx->block[ctx->len], message, rem_len);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:381: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(ctx->block, &shifted_message[block_nb << 6],
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:561: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(&ctx->block[ctx->len], message, rem_len);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:578: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(ctx->block, &shifted_message[block_nb << 7],
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:663: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(&ctx->block[ctx->len], message, rem_len);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:680: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(ctx->block, &shifted_message[block_nb << 7],
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:763: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(&ctx->block[ctx->len], message, rem_len);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:780: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(ctx->block, &shifted_message[block_nb << 6],
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:834: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 output[2 * SHA512_DIGEST_SIZE + 1];
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:840:8:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
       sprintf(output + 2 * i, "%02x", digest[i]);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:852:18:  [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 char *vectors[4][3] =
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:893: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 digest[SHA512_DIGEST_SIZE];
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.h:61: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 block[2 * SHA256_BLOCK_SIZE];
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.h:68: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 block[2 * SHA512_BLOCK_SIZE];
data/zchunk-1.1.7+ds1/src/lib/header.c:119: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(zck->full_hash_digest, header+length, zck->hash_type.digest_size);
data/zchunk-1.1.7+ds1/src/lib/header.c:240: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(header + length, zck->full_hash_digest, zck->hash_type.digest_size);
data/zchunk-1.1.7+ds1/src/lib/header.c:289: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(header, "\0ZCK1", 5);
data/zchunk-1.1.7+ds1/src/lib/header.c:343: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(zck->header + offs, zck->lead_string, zck->lead_size);
data/zchunk-1.1.7+ds1/src/lib/header.c:347: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(zck->header + offs, zck->preface_string, zck->preface_size);
data/zchunk-1.1.7+ds1/src/lib/header.c:351: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(zck->header + offs, zck->index_string, zck->index_size);
data/zchunk-1.1.7+ds1/src/lib/header.c:355: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(zck->header + offs, zck->sig_string, zck->sig_size);
data/zchunk-1.1.7+ds1/src/lib/header.c:379: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(zck->lead_string+zck->hdr_digest_loc, zck->header_digest,
data/zchunk-1.1.7+ds1/src/lib/header.c:478: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(zck->header_digest, header + length, zck->hash_type.digest_size);
data/zchunk-1.1.7+ds1/src/lib/index/index_create.c:53: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(item->digest, digest, index->digest_size);
data/zchunk-1.1.7+ds1/src/lib/index/index_create.c:104: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(index+index_size, tmp->digest, zck->index.digest_size);
data/zchunk-1.1.7+ds1/src/lib/index/index_read.c:78: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(new->digest, data+length, zck->index.digest_size);
data/zchunk-1.1.7+ds1/src/lib/zck.c:160:15:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    temp_fd = mkstemp(fname);
data/zchunk-1.1.7+ds1/src/lib/zck.c:207: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(data, value, length);
data/zchunk-1.1.7+ds1/src/unzck.c:59: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 *args[1];
data/zchunk-1.1.7+ds1/src/unzck.c:131:18:  [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 src_fd = open(arguments.args[0], O_RDONLY);
data/zchunk-1.1.7+ds1/src/unzck.c:150:18:  [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).
        dst_fd = open(out_name, O_TRUNC | O_WRONLY | O_CREAT, 0666);
data/zchunk-1.1.7+ds1/src/zck.c:65: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 *args[1];
data/zchunk-1.1.7+ds1/src/zck.c:157:23:  [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 dict_fd = open(arguments.dict, O_RDONLY);
data/zchunk-1.1.7+ds1/src/zck.c:183:18:  [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 dst_fd = open(out_name, O_TRUNC | O_WRONLY | O_CREAT, 0666);
data/zchunk-1.1.7+ds1/src/zck.c:227: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).
    int in_fd = open(arguments.args[0], O_RDONLY);
data/zchunk-1.1.7+ds1/src/zck_delta_size.c:54: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 *args[2];
data/zchunk-1.1.7+ds1/src/zck_delta_size.c:112:18:  [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 src_fd = open(arguments.args[0], O_RDONLY);
data/zchunk-1.1.7+ds1/src/zck_delta_size.c:132:18:  [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 tgt_fd = open(arguments.args[1], O_RDONLY);
data/zchunk-1.1.7+ds1/src/zck_dl.c:70: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 *args[1];
data/zchunk-1.1.7+ds1/src/zck_dl.c:291:22:  [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 src_fd = open(arguments.source, O_RDONLY);
data/zchunk-1.1.7+ds1/src/zck_dl.c:318:18:  [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 dst_fd = open(outname, O_RDWR | O_CREAT, 0666);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:62: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 *args[1];
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:168:18:  [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 src_fd = open(arguments.args[0], O_RDONLY);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:228:22:  [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 dst_fd = open(dict_block, O_TRUNC | O_WRONLY | O_CREAT, 0666);
data/zchunk-1.1.7+ds1/src/zck_read_header.c:55: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 *args[1];
data/zchunk-1.1.7+ds1/src/zck_read_header.c:125:18:  [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 src_fd = open(arguments.args[0], O_RDONLY);
data/zchunk-1.1.7+ds1/test/copy_chunks.c:48: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 in = open(argv[1], O_RDONLY);
data/zchunk-1.1.7+ds1/test/copy_chunks.c:53:15:  [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 tgt = open(base_name, O_RDWR | O_CREAT, 0666);
data/zchunk-1.1.7+ds1/test/copy_chunks.c:58: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[4096] = {0};
data/zchunk-1.1.7+ds1/test/copy_chunks.c:78:15:  [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 src = open(argv[2], O_RDONLY);
data/zchunk-1.1.7+ds1/test/empty.c:44:15:  [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 out = open("empty.zck", O_WRONLY | O_CREAT | O_TRUNC, 0666);
data/zchunk-1.1.7+ds1/test/empty.c:63: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 in = open("empty.zck", O_RDONLY);
data/zchunk-1.1.7+ds1/test/invalid_input_checksum.c:42: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 in = open(argv[1], O_RDONLY);
data/zchunk-1.1.7+ds1/test/optelems.c:42: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[1000] = {0};
data/zchunk-1.1.7+ds1/test/optelems.c:45: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 in = open(argv[1], O_RDONLY);
data/zchunk-1.1.7+ds1/test/read_single_chunk.c:45: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 in = open(argv[1], O_RDONLY);
data/zchunk-1.1.7+ds1/test/read_single_comp_chunk.c:45: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 in = open(argv[1], O_RDONLY);
data/zchunk-1.1.7+ds1/test/shacheck.c:87: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 in = open(outf, O_RDONLY);
data/zchunk-1.1.7+ds1/test/shacheck.c:94: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[1024*1024] = {0};
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:43:29:  [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).
    char *regex_b = zmalloc(strlen(regex) + strlen(boundary) + 1);
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:43:45:  [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).
    char *regex_b = zmalloc(strlen(regex) + strlen(boundary) + 1);
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:44:26:  [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(snprintf(regex_b, strlen(regex) + strlen(boundary), regex,
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:44:42:  [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(snprintf(regex_b, strlen(regex) + strlen(boundary), regex,
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:45:30:  [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).
                boundary) != strlen(regex) + strlen(boundary) - 2) {
data/zchunk-1.1.7+ds1/src/lib/dl/multipart.c:45:46:  [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).
                boundary) != strlen(regex) + strlen(boundary) - 2) {
data/zchunk-1.1.7+ds1/src/lib/error.c:61:20:  [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).
        old_size = strlen(zck->msg);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:905:46:  [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).
    sha224((const unsigned char *) message1, strlen(message1), digest);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:907: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).
    sha224((const unsigned char *) message2a, strlen(message2a), digest);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:915:46:  [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).
    sha256((const unsigned char *) message1, strlen(message1), digest);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:917: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).
    sha256((const unsigned char *) message2a, strlen(message2a), digest);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:925:46:  [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).
    sha384((const unsigned char *) message1, strlen(message1), digest);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:927:46:  [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).
    sha384((const unsigned char *)message2b, strlen(message2b), digest);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:935:46:  [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).
    sha512((const unsigned char *) message1, strlen(message1), digest);
data/zchunk-1.1.7+ds1/src/lib/hash/sha2/sha2.c:937: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).
    sha512((const unsigned char *) message2b, strlen(message2b), digest);
data/zchunk-1.1.7+ds1/src/lib/io.c:46:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t read_bytes = read(zck->fd, data, length);
data/zchunk-1.1.7+ds1/src/lib/io.c:117:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while((read_count = read(zck->temp_fd, data, BUF_SIZE)) > 0) {
data/zchunk-1.1.7+ds1/src/lib/uthash.h:92:26:  [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).
#define uthash_strlen(s) strlen(s)
data/zchunk-1.1.7+ds1/src/lib/zck.c:141: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).
    } else if(strlen(tmpdir) > 1024) {
data/zchunk-1.1.7+ds1/src/lib/zck.c:146: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).
    fname = zmalloc(strlen(template) + strlen(tmpdir) + 2);
data/zchunk-1.1.7+ds1/src/lib/zck.c:146:40:  [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).
    fname = zmalloc(strlen(template) + strlen(tmpdir) + 2);
data/zchunk-1.1.7+ds1/src/lib/zck.c:148:16:  [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).
    for(i=0; i<strlen(tmpdir); i++)
data/zchunk-1.1.7+ds1/src/lib/zck.c:153:16:  [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).
    for(i=0; i<strlen(template); i++)
data/zchunk-1.1.7+ds1/src/lib/zck.c:159:21:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    old_mode_mask = umask (S_IXUSR | S_IRWXG | S_IRWXO);
data/zchunk-1.1.7+ds1/src/lib/zck.c:161:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(old_mode_mask);
data/zchunk-1.1.7+ds1/src/unzck.c:125:12:  [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(arguments.args[0]) < 5 ||
data/zchunk-1.1.7+ds1/src/unzck.c:126: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).
           strcmp(arguments.args[0] + strlen(arguments.args[0]) - 4, ".zck") != 0) {
data/zchunk-1.1.7+ds1/src/unzck.c:140:27:  [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).
        out_name = calloc(strlen(base_name) + 3, 1); // len .zck -> .zdict = +2
data/zchunk-1.1.7+ds1/src/unzck.c:142:27:  [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).
        out_name = calloc(strlen(base_name) - 2, 1);
data/zchunk-1.1.7+ds1/src/unzck.c:144:24:  [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).
    snprintf(out_name, strlen(base_name) - 3, "%s", base_name); //Strip off .zck
data/zchunk-1.1.7+ds1/src/unzck.c:146:29:  [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).
        snprintf(out_name + strlen(base_name) - 4, 7, ".zdict");
data/zchunk-1.1.7+ds1/src/unzck.c:217:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if(read < 0) {
data/zchunk-1.1.7+ds1/src/unzck.c:223:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if(write(dst_fd, data, read) != read) {
data/zchunk-1.1.7+ds1/src/unzck.c:223:41:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if(write(dst_fd, data, read) != read) {
data/zchunk-1.1.7+ds1/src/unzck.c:227:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        total += read;
data/zchunk-1.1.7+ds1/src/zck.c:143:27:  [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).
        out_name = malloc(strlen(base_name) + 5);
data/zchunk-1.1.7+ds1/src/zck.c:145: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).
        snprintf(out_name, strlen(base_name) + 5, "%s.zck", base_name);
data/zchunk-1.1.7+ds1/src/zck.c:148:27:  [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).
        out_name = malloc(strlen(base_name) + 1);
data/zchunk-1.1.7+ds1/src/zck.c:150: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).
        snprintf(out_name, strlen(base_name) + 1, "%s", base_name);
data/zchunk-1.1.7+ds1/src/zck.c:175:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if(read(dict_fd, dict, dict_size) < dict_size) {
data/zchunk-1.1.7+ds1/src/zck.c:247:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if(read(in_fd, data, in_size) < in_size) {
data/zchunk-1.1.7+ds1/src/zck.c:259:37:  [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).
                                    strlen(arguments.split_string));
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:123: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).
        } else if(strlen(tmpdir) > 1024) {
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:128:33:  [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).
        char *base_dir = calloc(strlen(template) + strlen(tmpdir) + 2, 1);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:128:52:  [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).
        char *base_dir = calloc(strlen(template) + strlen(tmpdir) + 2, 1);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:131:20:  [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).
        for(i=0; i<strlen(tmpdir); i++)
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:136:20:  [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).
        for(i=0; i<strlen(template); i++)
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:146:22:  [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).
        dir = calloc(strlen(old_dir) + 1, 1);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:149:20:  [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).
        for(i=0; i<strlen(old_dir); i++)
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:176:29:  [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).
    char *out_name = calloc(strlen(base_name) + 3, 1);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:178:24:  [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).
    snprintf(out_name, strlen(base_name) - 3, "%s", base_name); //Strip off .zck
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:224:35:  [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).
        char *dict_block = calloc(strlen(dir) + strlen(out_name) + 12, 1);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:224:49:  [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).
        char *dict_block = calloc(strlen(dir) + strlen(out_name) + 12, 1);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:226:30:  [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).
        snprintf(dict_block, strlen(dir) + strlen(out_name) + 12, "%s/%s.%li",
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:226:44:  [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).
        snprintf(dict_block, strlen(dir) + strlen(out_name) + 12, "%s/%s.%li",
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:244:25:  [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).
    snprintf(out_name + strlen(base_name) - 4, 7, ".zdict");
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:284: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).
            char *full_path = calloc(strlen(dir) + strlen(dp->d_name) + 2, 1);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:284:52:  [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).
            char *full_path = calloc(strlen(dir) + strlen(dp->d_name) + 2, 1);
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:285:33:  [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).
            snprintf(full_path, strlen(dir) + strlen(dp->d_name) + 2, "%s/%s",
data/zchunk-1.1.7+ds1/src/zck_gen_zdict.c:285: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).
            snprintf(full_path, strlen(dir) + strlen(dp->d_name) + 2, "%s/%s",
data/zchunk-1.1.7+ds1/test/copy_chunks.c:44:26:  [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).
    char *path = zmalloc(strlen(argv[1])+1);
data/zchunk-1.1.7+ds1/test/copy_chunks.c:60:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while((len=read(in, buffer, 4096)) > 0) {
data/zchunk-1.1.7+ds1/test/empty.c:74:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t len = read(in, data, 1000);
data/zchunk-1.1.7+ds1/test/empty.c:81: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).
    if(memcmp(cksum, checksum, strlen(cksum)) != 0) {
data/zchunk-1.1.7+ds1/test/read_single_chunk.c:103:33:  [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(memcmp(cksum, echecksum, strlen(echecksum)) != 0) {
data/zchunk-1.1.7+ds1/test/read_single_comp_chunk.c:92:33:  [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(memcmp(cksum, echecksum, strlen(echecksum)) != 0) {
data/zchunk-1.1.7+ds1/test/shacheck.c:42: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).
    char *output = zmalloc(strlen(input)+1);
data/zchunk-1.1.7+ds1/test/shacheck.c:44:16:  [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).
    for(i=0; i<strlen(input); i++)
data/zchunk-1.1.7+ds1/test/shacheck.c:95:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t len = read(in, data, 1024*1024);
data/zchunk-1.1.7+ds1/test/shacheck.c:105:33:  [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(memcmp(cksum, echecksum, strlen(echecksum)) != 0) {

ANALYSIS SUMMARY:

Hits = 158
Lines analyzed = 10301 in approximately 0.32 seconds (32155 lines/second)
Physical Source Lines of Code (SLOC) = 7818
Hits@level = [0] 111 [1]  70 [2]  78 [3]   2 [4]   8 [5]   0
Hits@level+ = [0+] 269 [1+] 158 [2+]  88 [3+]  10 [4+]   8 [5+]   0
Hits/KSLOC@level+ = [0+] 34.4078 [1+] 20.2098 [2+] 11.2561 [3+] 1.2791 [4+] 1.02328 [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.