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/highwayhash-0~git20200803.9490b14/c/highwayhash.c
Examining data/highwayhash-0~git20200803.9490b14/c/highwayhash.h
Examining data/highwayhash-0~git20200803.9490b14/c/highwayhash_test.c
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/arch_specific.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/arch_specific.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/c_bindings.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/c_bindings.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/compiler_specific.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/data_parallel.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/data_parallel_benchmark.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/data_parallel_test.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/endianess.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/example.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_avx2.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_avx2.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_buffer.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_neon.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_neon.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_portable.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_portable.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_sse41.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_sse41.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_types.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_vsx.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/hh_vsx.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_fuzzer.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_target.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_target.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test_avx2.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test_neon.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test_portable.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test_sse41.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test_target.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test_target.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test_vsx.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/iaca.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/instruction_sets.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/instruction_sets.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/load3.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/nanobenchmark.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/nanobenchmark.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/nanobenchmark_example.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/os_mac.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/os_mac.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/os_specific.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/os_specific.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/profiler.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/profiler_example.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/robust_statistics.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/scalar.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/scalar_sip_tree_hash.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/scalar_sip_tree_hash.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/sip_hash.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/sip_hash.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/sip_hash_fuzzer.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/sip_hash_test.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/sip_tree_hash.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/sip_tree_hash.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/state_helpers.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/tsc_timer.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector128.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector256.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector_neon.h
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector_test.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector_test_avx2.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector_test_neon.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector_test_portable.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector_test_sse41.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector_test_target.cc
Examining data/highwayhash-0~git20200803.9490b14/highwayhash/vector_test_target.h
Examining data/highwayhash-0~git20200803.9490b14/debian/sanity_test.c

FINAL RESULTS:

data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test.cc:116:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(129);
data/highwayhash-0~git20200803.9490b14/highwayhash/arch_specific.cc: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 brand_string[49];
data/highwayhash-0~git20200803.9490b14/highwayhash/arch_specific.cc:70: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(brand_string + i * 16, &abcd, sizeof(abcd));
data/highwayhash-0~git20200803.9490b14/highwayhash/arch_specific.cc:127: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 line[200];
data/highwayhash-0~git20200803.9490b14/highwayhash/arch_specific.cc:131:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* f = fopen("/proc/cpuinfo", "r");
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc:212: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 in[kMaxBenchmarkInputSize];
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc: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(in, &size, sizeof(size));
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc:219: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 in[kMaxBenchmarkInputSize];
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc:220: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(in, &size, sizeof(size));
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc:230: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 in[kMaxBenchmarkInputSize];
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc:231: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(in, &size, sizeof(size));
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc:237: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 in[kMaxBenchmarkInputSize];
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc:238: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(in, &size, sizeof(size));
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc:247: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 in[kMaxBenchmarkInputSize];
data/highwayhash-0~git20200803.9490b14/highwayhash/benchmark.cc:248: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(in, &size, sizeof(size));
data/highwayhash-0~git20200803.9490b14/highwayhash/hh_types.h:36: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.
typedef char HHPacket[32];
data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test.cc:80: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 in[kMaxSize + 1] = {0};
data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test.cc: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 flat[kMaxSize];
data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test_target.cc:166: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 in[kMaxBenchmarkInputSize];
data/highwayhash-0~git20200803.9490b14/highwayhash/highwayhash_test_target.cc:178: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 in[kMaxBenchmarkInputSize];
data/highwayhash-0~git20200803.9490b14/highwayhash/nanobenchmark_example.cc:30: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 from[8] = {static_cast<char>(size)};
data/highwayhash-0~git20200803.9490b14/highwayhash/nanobenchmark_example.cc:31: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 to[8];
data/highwayhash-0~git20200803.9490b14/highwayhash/nanobenchmark_example.cc:32: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(to, from, size);
data/highwayhash-0~git20200803.9490b14/highwayhash/profiler.h:115: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(aligned - kPointerSize, &allocated, kPointerSize);
data/highwayhash-0~git20200803.9490b14/highwayhash/profiler.h:128: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(&allocated, aligned - kPointerSize, kPointerSize);
data/highwayhash-0~git20200803.9490b14/highwayhash/profiler.h:520: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(packets_ + num_packets_, buffer_, buffer_size_ * sizeof(Packet));
data/highwayhash-0~git20200803.9490b14/highwayhash/scalar_sip_tree_hash.cc:135: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 final_packet[kPacketSize] = {0};
data/highwayhash-0~git20200803.9490b14/highwayhash/scalar_sip_tree_hash.cc:136: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(final_packet, bytes + truncated_size, remainder - remainder_mod4);
data/highwayhash-0~git20200803.9490b14/highwayhash/scalar_sip_tree_hash.cc:137: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(final_packet + kPacketSize - 4, &packet4, sizeof(packet4));
data/highwayhash-0~git20200803.9490b14/highwayhash/sip_hash.h: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 final_packet[SipHashState::kPacketSize] = {0};
data/highwayhash-0~git20200803.9490b14/highwayhash/sip_hash.h:115: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(final_packet, remaining_bytes, remaining_size);
data/highwayhash-0~git20200803.9490b14/highwayhash/sip_hash.h:126: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 final_packet[SipHash13State::kPacketSize] = {0};
data/highwayhash-0~git20200803.9490b14/highwayhash/sip_hash.h:127: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(final_packet, remaining_bytes, remaining_size);
data/highwayhash-0~git20200803.9490b14/highwayhash/sip_hash_test.cc:35: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 in[kMaxSize];  // empty string, 00, 00 01, ...
data/highwayhash-0~git20200803.9490b14/highwayhash/state_helpers.h:49: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 final_packet[State::kPacketSize] HH_ALIGNAS(32) = {0};
data/highwayhash-0~git20200803.9490b14/highwayhash/state_helpers.h:64: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(final_packet, remaining_bytes, remaining_size - remainder_mod4);
data/highwayhash-0~git20200803.9490b14/highwayhash/state_helpers.h:65: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(final_packet + State::kPacketSize - 4, &packet4, sizeof(packet4));
data/highwayhash-0~git20200803.9490b14/highwayhash/arch_specific.cc:142:39:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      if (!strncasecmp(line, "clock", strlen("clock")) &&
data/highwayhash-0~git20200803.9490b14/highwayhash/data_parallel_test.cc:36:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
  usleep(200000);
data/highwayhash-0~git20200803.9490b14/highwayhash/data_parallel_test.cc:41:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
  usleep(300000);
data/highwayhash-0~git20200803.9490b14/highwayhash/data_parallel_test.cc:46:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
  usleep(400000);
data/highwayhash-0~git20200803.9490b14/highwayhash/example.cc:23: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).
  const size_t size = strlen(in);

ANALYSIS SUMMARY:

Hits = 42
Lines analyzed = 12420 in approximately 0.32 seconds (39180 lines/second)
Physical Source Lines of Code (SLOC) = 8132
Hits@level = [0]  45 [1]   5 [2]  36 [3]   1 [4]   0 [5]   0
Hits@level+ = [0+]  87 [1+]  42 [2+]  37 [3+]   1 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 10.6985 [1+] 5.16478 [2+] 4.54993 [3+] 0.122971 [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.