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/gemmlowp-0.0~git20200506.fda83bd/doc/quantization_example.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/eight_bit_int_gemm/eight_bit_int_gemm.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/eight_bit_int_gemm/eight_bit_int_gemm.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/fixedpoint/fixedpoint.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/fixedpoint/fixedpoint_avx.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/fixedpoint/fixedpoint_msa.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/fixedpoint/fixedpoint_neon.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/fixedpoint/fixedpoint_sse.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/allocator.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/block_params.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/common.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/compute.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/detect_platform.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/dispatch_gemm_shape.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/kernel.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/kernel_avx.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/kernel_default.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/kernel_msa.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/kernel_neon.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/kernel_reference.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/kernel_sse.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/multi_thread_gemm.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/output.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/output_avx.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/output_msa.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/output_neon.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/output_sse.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/pack.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/pack_avx.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/pack_msa.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/pack_neon.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/pack_sse.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/platform.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/simd_wrappers.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/simd_wrappers_common_neon_sse.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/simd_wrappers_msa.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/simd_wrappers_neon.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/simd_wrappers_sse.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/single_thread_gemm.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/internal/unpack.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/base.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/legacy_multi_thread_common.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/legacy_multi_thread_gemm.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/legacy_multi_thread_gemv.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/legacy_operations_common.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/legacy_single_thread_gemm.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/multi_thread_common.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/multi_thread_gemm.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/multi_thread_transform.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/quantized_mul_kernels.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/quantized_mul_kernels_arm_32.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/quantized_mul_kernels_arm_64.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/single_thread_gemm.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/single_thread_transform.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/streams.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/streams_arm_32.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/streams_arm_64.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/test_gemm_correctness.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/test_streams_correctness.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/test_transform_benchmark.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/test_transform_correctness.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/transform_kernels.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/transform_kernels_arm_32.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/meta/transform_kernels_arm_64.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/profiling/instrumentation.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/profiling/profiler.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/profiling/pthread_everywhere.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/public/bit_depth.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/public/gemmlowp.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/public/map.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/public/output_stages.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/standalone/cache_counters.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/standalone/neon-gemm-kernel-benchmark.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/benchmark.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/benchmark_all_sizes.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/benchmark_meta_gemm.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/correctness_meta_gemm.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/ios/gemmlowp_test/AppDelegate.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/ios/gemmlowp_test/ViewController.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/test.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/test.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/test_allocator.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/test_blocking_counter.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/test_data.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/test_data.h
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/test_fixedpoint.cc
Examining data/gemmlowp-0.0~git20200506.fda83bd/test/test_math_helpers.cc

FINAL RESULTS:

data/gemmlowp-0.0~git20200506.fda83bd/standalone/cache_counters.cc:195:27:  [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.
  const bool only_reads = getenv("ONLY_READS");
data/gemmlowp-0.0~git20200506.fda83bd/standalone/cache_counters.cc:363:7:  [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 (getenv("DUMP_CSV")) {
data/gemmlowp-0.0~git20200506.fda83bd/standalone/neon-gemm-kernel-benchmark.cc:5799:41:  [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.
  static const char* cache_size_k_env = getenv("CACHE_SIZE_KB");
data/gemmlowp-0.0~git20200506.fda83bd/standalone/neon-gemm-kernel-benchmark.cc:5879:7:  [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 (getenv("BENCHMARK_KERNEL")) {
data/gemmlowp-0.0~git20200506.fda83bd/standalone/neon-gemm-kernel-benchmark.cc:5880: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 (strcmp(getenv("BENCHMARK_KERNEL"), kernel_name)) {
data/gemmlowp-0.0~git20200506.fda83bd/standalone/neon-gemm-kernel-benchmark.cc:5889:7:  [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 (getenv("BENCHMARK_ALL_DEPTHS")) {
data/gemmlowp-0.0~git20200506.fda83bd/standalone/neon-gemm-kernel-benchmark.cc:5908:7:  [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 (getenv("BENCHMARK_ALL_DEPTHS")) {
data/gemmlowp-0.0~git20200506.fda83bd/internal/kernel_reference.h:37: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[256];
data/gemmlowp-0.0~git20200506.fda83bd/internal/pack.h:249: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_ + w * kRegisterSize, src.data(w, 0), src.depth());
data/gemmlowp-0.0~git20200506.fda83bd/internal/pack.h:254: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_ + d * kKernelWidth, src.data(0, d), src.width());
data/gemmlowp-0.0~git20200506.fda83bd/internal/single_thread_gemm.h:103: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 label[256];
data/gemmlowp-0.0~git20200506.fda83bd/profiling/instrumentation.h:140: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(this, &other, sizeof(ProfilingStack));
data/gemmlowp-0.0~git20200506.fda83bd/standalone/neon-gemm-kernel-benchmark.cc:5694: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(dst->data(), src.data(), src.size() * sizeof(DataType));
data/gemmlowp-0.0~git20200506.fda83bd/standalone/neon-gemm-kernel-benchmark.cc:5801:26:  [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).
      cache_size_k_env ? atoi(cache_size_k_env) : kDefaultCacheSizeK;
data/gemmlowp-0.0~git20200506.fda83bd/test/benchmark_all_sizes.cc:74:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    std::memcpy(data_, other.data_, size() * sizeof(Scalar));
data/gemmlowp-0.0~git20200506.fda83bd/test/test.cc:122: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[256];
data/gemmlowp-0.0~git20200506.fda83bd/test/test.cc:162: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[256];
data/gemmlowp-0.0~git20200506.fda83bd/test/test.h:68:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    std::memcpy(data_, other.data_, size() * sizeof(Scalar));
data/gemmlowp-0.0~git20200506.fda83bd/test/test_data.cc:35:10:  [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 a_data[a_count] = {
data/gemmlowp-0.0~git20200506.fda83bd/test/test_data.cc:22157:10:  [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 b_data[b_count] = {
data/gemmlowp-0.0~git20200506.fda83bd/test/test_data.cc:51652:10:  [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 expected_c_data[c_count] = {
data/gemmlowp-0.0~git20200506.fda83bd/internal/platform.h:82:10:  [1] (free) memalign:
  On some systems (though not Linux-based systems) an attempt to free()
  results from memalign() may fail. This may, on a few systems, be
  exploitable. Also note that memalign() may not check that the boundary
  parameter is correct (CWE-676). Use posix_memalign instead (defined in
  POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD
  4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases,
  malloc()'s alignment may be sufficient.
  return memalign(alignment, size);
data/gemmlowp-0.0~git20200506.fda83bd/standalone/cache_counters.cc:43:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(fd, &count, sizeof(count));

ANALYSIS SUMMARY:

Hits = 23
Lines analyzed = 138275 in approximately 5.34 seconds (25912 lines/second)
Physical Source Lines of Code (SLOC) = 122719
Hits@level = [0]  60 [1]   2 [2]  14 [3]   7 [4]   0 [5]   0
Hits@level+ = [0+]  83 [1+]  23 [2+]  21 [3+]   7 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 0.676342 [1+] 0.18742 [2+] 0.171123 [3+] 0.0570409 [4+]   0 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.