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/libgpuarray-0.7.6/pygpu/numpy_compat.h
Examining data/libgpuarray-0.7.6/src/cache.h
Examining data/libgpuarray-0.7.6/src/cache/disk.c
Examining data/libgpuarray-0.7.6/src/cache/lru.c
Examining data/libgpuarray-0.7.6/src/cache/twoq.c
Examining data/libgpuarray-0.7.6/src/cluda_cuda.h
Examining data/libgpuarray-0.7.6/src/cluda_cuda.h.c
Examining data/libgpuarray-0.7.6/src/cluda_opencl.h
Examining data/libgpuarray-0.7.6/src/cluda_opencl.h.c
Examining data/libgpuarray-0.7.6/src/gpuarray/array.h
Examining data/libgpuarray-0.7.6/src/gpuarray/blas.h
Examining data/libgpuarray-0.7.6/src/gpuarray/buffer.h
Examining data/libgpuarray-0.7.6/src/gpuarray/buffer_blas.h
Examining data/libgpuarray-0.7.6/src/gpuarray/buffer_collectives.h
Examining data/libgpuarray-0.7.6/src/gpuarray/collectives.h
Examining data/libgpuarray-0.7.6/src/gpuarray/config.h
Examining data/libgpuarray-0.7.6/src/gpuarray/elemwise.h
Examining data/libgpuarray-0.7.6/src/gpuarray/error.h
Examining data/libgpuarray-0.7.6/src/gpuarray/ext_cuda.h
Examining data/libgpuarray-0.7.6/src/gpuarray/extension.h
Examining data/libgpuarray-0.7.6/src/gpuarray/kernel.h
Examining data/libgpuarray-0.7.6/src/gpuarray/types.h
Examining data/libgpuarray-0.7.6/src/gpuarray/util.h
Examining data/libgpuarray-0.7.6/src/gpuarray/wincompat/stdint.h
Examining data/libgpuarray-0.7.6/src/gpuarray_array.c
Examining data/libgpuarray-0.7.6/src/gpuarray_array_blas.c
Examining data/libgpuarray-0.7.6/src/gpuarray_array_collectives.c
Examining data/libgpuarray-0.7.6/src/gpuarray_buffer.c
Examining data/libgpuarray-0.7.6/src/gpuarray_buffer_blas.c
Examining data/libgpuarray-0.7.6/src/gpuarray_buffer_collectives.c
Examining data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c
Examining data/libgpuarray-0.7.6/src/gpuarray_collectives_cuda_nccl.c
Examining data/libgpuarray-0.7.6/src/gpuarray_elemwise.c
Examining data/libgpuarray-0.7.6/src/gpuarray_error.c
Examining data/libgpuarray-0.7.6/src/gpuarray_extension.c
Examining data/libgpuarray-0.7.6/src/gpuarray_kernel.c
Examining data/libgpuarray-0.7.6/src/gpuarray_mkstemp.c
Examining data/libgpuarray-0.7.6/src/gpuarray_reduction.c
Examining data/libgpuarray-0.7.6/src/gpuarray_strl.c
Examining data/libgpuarray-0.7.6/src/gpuarray_types.c
Examining data/libgpuarray-0.7.6/src/gpuarray_util.c
Examining data/libgpuarray-0.7.6/src/loaders/dyn_load.c
Examining data/libgpuarray-0.7.6/src/loaders/dyn_load.h
Examining data/libgpuarray-0.7.6/src/loaders/libclblas.c
Examining data/libgpuarray-0.7.6/src/loaders/libclblas.h
Examining data/libgpuarray-0.7.6/src/loaders/libclblast.c
Examining data/libgpuarray-0.7.6/src/loaders/libclblast.h
Examining data/libgpuarray-0.7.6/src/loaders/libcublas.c
Examining data/libgpuarray-0.7.6/src/loaders/libcublas.h
Examining data/libgpuarray-0.7.6/src/loaders/libcuda.c
Examining data/libgpuarray-0.7.6/src/loaders/libcuda.h
Examining data/libgpuarray-0.7.6/src/loaders/libnccl.c
Examining data/libgpuarray-0.7.6/src/loaders/libnccl.h
Examining data/libgpuarray-0.7.6/src/loaders/libnvrtc.c
Examining data/libgpuarray-0.7.6/src/loaders/libnvrtc.h
Examining data/libgpuarray-0.7.6/src/loaders/libopencl.c
Examining data/libgpuarray-0.7.6/src/loaders/libopencl.h
Examining data/libgpuarray-0.7.6/src/private.h
Examining data/libgpuarray-0.7.6/src/private_cuda.h
Examining data/libgpuarray-0.7.6/src/private_opencl.h
Examining data/libgpuarray-0.7.6/src/util/error.c
Examining data/libgpuarray-0.7.6/src/util/error.h
Examining data/libgpuarray-0.7.6/src/util/integerfactoring.c
Examining data/libgpuarray-0.7.6/src/util/integerfactoring.h
Examining data/libgpuarray-0.7.6/src/util/skein.c
Examining data/libgpuarray-0.7.6/src/util/skein.h
Examining data/libgpuarray-0.7.6/src/util/strb.c
Examining data/libgpuarray-0.7.6/src/util/strb.h
Examining data/libgpuarray-0.7.6/src/util/xxhash.c
Examining data/libgpuarray-0.7.6/src/util/xxhash.h
Examining data/libgpuarray-0.7.6/src/gpuarray_blas_cuda_cublas.c
Examining data/libgpuarray-0.7.6/src/gpuarray_blas_opencl_clblast.c
Examining data/libgpuarray-0.7.6/src/gpuarray_blas_opencl_clblas.c
Examining data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c
Examining data/libgpuarray-0.7.6/tests/check_array.c
Examining data/libgpuarray-0.7.6/tests/check_blas.c
Examining data/libgpuarray-0.7.6/tests/check_buffer.c
Examining data/libgpuarray-0.7.6/tests/check_buffer_collectives.c
Examining data/libgpuarray-0.7.6/tests/check_collectives.c
Examining data/libgpuarray-0.7.6/tests/check_elemwise.c
Examining data/libgpuarray-0.7.6/tests/check_error.c
Examining data/libgpuarray-0.7.6/tests/check_reduction.c
Examining data/libgpuarray-0.7.6/tests/check_types.c
Examining data/libgpuarray-0.7.6/tests/check_util.c
Examining data/libgpuarray-0.7.6/tests/check_util_integerfactoring.c
Examining data/libgpuarray-0.7.6/tests/communicator.c
Examining data/libgpuarray-0.7.6/tests/device.c
Examining data/libgpuarray-0.7.6/tests/main.c

FINAL RESULTS:

data/libgpuarray-0.7.6/src/gpuarray_array.c:1092:5:  [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.
    fprintf(fd, " " #flag);                   \
data/libgpuarray-0.7.6/src/gpuarray_mkstemp.c:10:9:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
#define mktemp _mktemp
data/libgpuarray-0.7.6/src/gpuarray_mkstemp.c:21:15:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
        tmp = mktemp(path);
data/libgpuarray-0.7.6/src/util/error.c:37:3:  [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(e->msg, ERROR_MSGBUF_LEN, fmt, ap);
data/libgpuarray-0.7.6/src/util/strb.c:54:7:  [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.
  s = vsnprintf(NULL, 0, f, ap);
data/libgpuarray-0.7.6/src/util/strb.c:63:7:  [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.
  s = vsnprintf(sb->s+sb->l, s, f, ap);
data/libgpuarray-0.7.6/tests/check_buffer_collectives.c:48:7:  [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(STR(t) " ", ar[li]);  \
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:299:18:  [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.
    cache_path = getenv("GPUARRAY_CACHE_PATH");
data/libgpuarray-0.7.6/src/loaders/dyn_load.c:44:15:  [3] (misc) LoadLibrary:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
  void *res = LoadLibrary(name);
data/libgpuarray-0.7.6/tests/device.c:19:16:  [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.
    if ((dev = getenv("GPUARRAY_TEST_DEVICE")) == NULL) {
data/libgpuarray-0.7.6/tests/device.c:20:18:  [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.
      if ((dev = getenv("DEVICE")) == NULL) {
data/libgpuarray-0.7.6/src/cache/disk.c:50:9:  [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).
#define open _open
data/libgpuarray-0.7.6/src/cache/disk.c:124: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 path[PATH_MAX];
data/libgpuarray-0.7.6/src/cache/disk.c:129: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).
  return open(path, flags, mode);
data/libgpuarray-0.7.6/src/cache/disk.c:133: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 path[PATH_MAX];
data/libgpuarray-0.7.6/src/cache/disk.c:139:9:  [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).
  res = mkstemp(path);
data/libgpuarray-0.7.6/src/cache/disk.c:144: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(template, &path[strlen(dirp)], strlen(template));
data/libgpuarray-0.7.6/src/cache/disk.c:151: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 path[PATH_MAX];
data/libgpuarray-0.7.6/src/cache/disk.c:160: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 opath[PATH_MAX];
data/libgpuarray-0.7.6/src/cache/disk.c:161: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 npath[PATH_MAX];
data/libgpuarray-0.7.6/src/cache/disk.c:173: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 path[PATH_MAX];
data/libgpuarray-0.7.6/src/cache/disk.c:216: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 hash[64];
data/libgpuarray-0.7.6/src/cache/disk.c:241: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 hexp[HEXP_LEN];
data/libgpuarray-0.7.6/src/cache/disk.c:298: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 hexp[HEXP_LEN];
data/libgpuarray-0.7.6/src/cache/disk.c:374: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 hexp[HEXP_LEN] = {0};
data/libgpuarray-0.7.6/src/gpuarray/buffer_collectives.h:43: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 internal[GA_COMM_ID_BYTES];
data/libgpuarray-0.7.6/src/gpuarray/extension.h:23: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 priv[64];
data/libgpuarray-0.7.6/src/gpuarray_array.c:148: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(a->dimensions, dims, sizeof(size_t)*nd);
data/libgpuarray-0.7.6/src/gpuarray_array.c:212: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(a->dimensions, dims, nd*sizeof(size_t));
data/libgpuarray-0.7.6/src/gpuarray_array.c:213: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(a->strides, strides, nd*sizeof(ssize_t));
data/libgpuarray-0.7.6/src/gpuarray_array.c:234: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(v->dimensions, a->dimensions, v->nd*sizeof(size_t));
data/libgpuarray-0.7.6/src/gpuarray_array.c:235: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(v->strides, a->strides, v->nd*sizeof(ssize_t));
data/libgpuarray-0.7.6/src/gpuarray_array.c:600: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(&tv, v, sizeof(GpuArray));
data/libgpuarray-0.7.6/src/gpuarray_array.c:729: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(tmpdims, newdims, nd*sizeof(size_t));
data/libgpuarray-0.7.6/src/gpuarray_array.c:749: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(tmpdims, newdims, nd*sizeof(size_t));
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:64: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 bin_id[64];
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:130: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(k, b->s, DISK_KEY_MM);
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:998: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(dst, (void *)(src->ptr + srcoff), sz);
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1033: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((void *)(dst->ptr + dstoff), src, sz);
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1107:9:  [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.
  const char *heads[1] = {"cluda.h"};
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1108:9:  [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.
  const char *hsrc[1];
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1163: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 info_log[2048] = "";
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1164: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 error_log[2048] = "";
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1228: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(k.bin_id, ctx->bin_id, 64);
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1229: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(&k.src, src, sizeof(strb));
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1254: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(pk, &k, DISK_KEY_MM);
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1430: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(res->types, types, argcount*sizeof(int));
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:114: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 vendor[32];
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:115: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 driver_version[64];
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:127:9:  [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.
  const char *rlk[1];
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:685: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 local_kern[256];
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:687:9:  [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.
  const char *rlk[1];
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:811:9:  [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.
  const char *preamble[5];
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:812:9:  [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.
  const char *cluda_src[1];
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:813:9:  [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.
  const char *headers[1] = {"cluda.h"};
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:836: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(news, preamble, n*sizeof(const char *));
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:837: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(news+n, strings, count*sizeof(const char *));
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:846: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(newl+n, lengths, count*sizeof(size_t));
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:949: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(res->types, types, argcount * sizeof(int));
data/libgpuarray-0.7.6/src/gpuarray_collectives_cuda_nccl.c:58: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 tag[8];
data/libgpuarray-0.7.6/src/gpuarray_elemwise.c:316: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(ge->dims, a->dimensions, nd*sizeof(size_t));
data/libgpuarray-0.7.6/src/gpuarray_elemwise.c:323: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((char *)(ge->strides[p]) + (nd - nd_i)*sizeof(ssize_t),
data/libgpuarray-0.7.6/src/gpuarray_mkstemp.c:9:9:  [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).
#define open _open
data/libgpuarray-0.7.6/src/gpuarray_mkstemp.c:15:5:  [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).
int mkstemp(char *path) {
data/libgpuarray-0.7.6/src/gpuarray_mkstemp.c:23: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).
        res = open(path, O_CREAT|O_EXCL|O_RDWR|O_BINARY, S_IREAD|S_IWRITE);
data/libgpuarray-0.7.6/src/gpuarray_reduction.c:625: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(&ctx->axisList[f], ctx->reduxList, ctx->ndr * sizeof(*ctx->reduxList));
data/libgpuarray-0.7.6/src/loaders/dyn_load.c:32: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 msgbuf[512];
data/libgpuarray-0.7.6/src/loaders/libcublas.c:45: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 libname[64];
data/libgpuarray-0.7.6/src/loaders/libcublas.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 libname[128];
data/libgpuarray-0.7.6/src/loaders/libcuda.h:43: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 reserved[CU_IPC_HANDLE_SIZE];
data/libgpuarray-0.7.6/src/loaders/libnccl.h:12: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.
typedef struct { char internal[NCCL_UNIQUE_ID_BYTES]; } ncclUniqueId;
data/libgpuarray-0.7.6/src/loaders/libnvrtc.c:31: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 libname[64];
data/libgpuarray-0.7.6/src/loaders/libnvrtc.c:45: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 libname[128];
data/libgpuarray-0.7.6/src/private.h:53: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 bin_id[64];                              \
data/libgpuarray-0.7.6/src/private.h: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 tag[8]
data/libgpuarray-0.7.6/src/private.h:283: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(res, p, s);
data/libgpuarray-0.7.6/src/private_cuda.h:20:20:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define TAG_CTX(c) memcpy((c)->tag, CTX_TAG, 8)
data/libgpuarray-0.7.6/src/private_cuda.h:21:20:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define TAG_BUF(b) memcpy((b)->tag, BUF_TAG, 8)
data/libgpuarray-0.7.6/src/private_cuda.h:22:20:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define TAG_KER(k) memcpy((k)->tag, KER_TAG, 8)
data/libgpuarray-0.7.6/src/private_cuda.h:23:22:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define TAG_COMM(co) memcpy((co)->tag, COMM_TAG, 8)
data/libgpuarray-0.7.6/src/private_cuda.h:125: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 tag[8];
data/libgpuarray-0.7.6/src/private_cuda.h:156: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 tag[8];
data/libgpuarray-0.7.6/src/private_opencl.h:16:20:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define TAG_CTX(c) memcpy((c)->tag, CTX_TAG, 8)
data/libgpuarray-0.7.6/src/private_opencl.h:17:20:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define TAG_BUF(b) memcpy((b)->tag, BUF_TAG, 8)
data/libgpuarray-0.7.6/src/private_opencl.h:18:20:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define TAG_KER(k) memcpy((k)->tag, KER_TAG, 8)
data/libgpuarray-0.7.6/src/private_opencl.h:89: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 tag[8];
data/libgpuarray-0.7.6/src/private_opencl.h:103: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 tag[8];
data/libgpuarray-0.7.6/src/util/error.h:13: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 msg[ERROR_MSGBUF_LEN];
data/libgpuarray-0.7.6/src/util/integerfactoring.c:1287:13:  [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.
			total += sprintf(ptr, "%llu*", (unsigned long long)fl->f[i]);
data/libgpuarray-0.7.6/src/util/integerfactoring.c:1296:12:  [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.
		total += sprintf(ptr, "1*");
data/libgpuarray-0.7.6/src/util/skein.c:250: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(&ctx->bb.b[ctx->h.bCnt],msg,n);
data/libgpuarray-0.7.6/src/util/skein.c:272: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->bb.b[ctx->h.bCnt],msg,msgByteCnt);
data/libgpuarray-0.7.6/src/util/skein.c:306: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->X,X,sizeof(X));   /* restore the counter mode key for next time */
data/libgpuarray-0.7.6/src/util/strb.h:134: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(sb->s+sb->l, s, n);
data/libgpuarray-0.7.6/src/util/xxhash.c:80:76:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); }
data/libgpuarray-0.7.6/src/cache/disk.c:144: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).
    memcpy(template, &path[strlen(dirp)], strlen(template));
data/libgpuarray-0.7.6/src/cache/disk.c:144:43:  [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).
    memcpy(template, &path[strlen(dirp)], strlen(template));
data/libgpuarray-0.7.6/src/cache/disk.c:198:17:  [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).
    pp = path + strlen(dirp);
data/libgpuarray-0.7.6/src/cache/disk.c:411:17:  [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 dirl = strlen(dirpath);
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:95:34:  [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).
  XXH32_update(&state, k->fname, strlen(k->fname));
data/libgpuarray-0.7.6/src/gpuarray_buffer_cuda.c:1089: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).
  size_t sz = strlen(prefix) + 3;
data/libgpuarray-0.7.6/src/gpuarray_buffer_opencl.c:756:8:  [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).
  sz = strlen(local_kern);
data/libgpuarray-0.7.6/src/gpuarray_strl.c:45: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).
    return(dlen + strlen(s));
data/libgpuarray-0.7.6/src/gpuarray_util.c:95:13:  [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(news[section]);
data/libgpuarray-0.7.6/src/util/integerfactoring.c:1289:14:  [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).
				ptr   += strlen(ptr);
data/libgpuarray-0.7.6/src/util/integerfactoring.c:1298:13:  [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).
			ptr   += strlen(ptr);
data/libgpuarray-0.7.6/src/util/strb.c:6:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#define read _read
data/libgpuarray-0.7.6/src/util/strb.c:75:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    res = read(fd, b, sz);
data/libgpuarray-0.7.6/src/util/strb.h:143: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).
  strb_appendn(sb, s, strlen(s));

ANALYSIS SUMMARY:

Hits = 109
Lines analyzed = 26769 in approximately 1.00 seconds (26808 lines/second)
Physical Source Lines of Code (SLOC) = 19235
Hits@level = [0]  68 [1]  14 [2]  84 [3]   4 [4]   7 [5]   0
Hits@level+ = [0+] 177 [1+] 109 [2+]  95 [3+]  11 [4+]   7 [5+]   0
Hits/KSLOC@level+ = [0+] 9.20198 [1+] 5.66675 [2+] 4.93891 [3+] 0.571874 [4+] 0.36392 [5+]   0
Dot directories skipped = 2 (--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.