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/libhpptools-1.1.1/examples/catch.hpp Examining data/libhpptools-1.1.1/examples/test-alg.cpp Examining data/libhpptools-1.1.1/examples/test-strict_fstream.cpp Examining data/libhpptools-1.1.1/examples/zc.cpp Examining data/libhpptools-1.1.1/examples/zpipe.cpp Examining data/libhpptools-1.1.1/examples/ztxtpipe.cpp Examining data/libhpptools-1.1.1/include/alg.hpp Examining data/libhpptools-1.1.1/include/logdiff.hpp Examining data/libhpptools-1.1.1/include/logger.hpp Examining data/libhpptools-1.1.1/include/logsum.hpp Examining data/libhpptools-1.1.1/include/logsumset.hpp Examining data/libhpptools-1.1.1/include/pfor.hpp Examining data/libhpptools-1.1.1/include/strict_fstream.hpp Examining data/libhpptools-1.1.1/include/tpool.hpp Examining data/libhpptools-1.1.1/include/zstr.hpp FINAL RESULTS: data/libhpptools-1.1.1/examples/catch.hpp:5726:22: [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. std::srand( m_configData.rngSeed ); data/libhpptools-1.1.1/examples/zc.cpp:95:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "co:h?")) != -1) data/libhpptools-1.1.1/examples/catch.hpp:1035: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. char sizer[1]; data/libhpptools-1.1.1/examples/catch.hpp:1040: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. char sizer[2]; data/libhpptools-1.1.1/examples/catch.hpp:2560: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. char storage[sizeof(T)]; data/libhpptools-1.1.1/examples/catch.hpp:5623: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). m_ofs.open( m_config->getFilename().c_str() ); data/libhpptools-1.1.1/examples/catch.hpp:6136: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. char data[bufferSize]; data/libhpptools-1.1.1/examples/catch.hpp:7256:21: [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 asChar[sizeof (int)]; data/libhpptools-1.1.1/examples/catch.hpp:7821:16: [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 line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; data/libhpptools-1.1.1/examples/test-strict_fstream.cpp:18: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). s_p->open(filename, static_cast< std::ios_base::openmode >(mode)); data/libhpptools-1.1.1/include/strict_fstream.hpp:55:22: [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 * mode_name_v[n_modes] = data/libhpptools-1.1.1/include/strict_fstream.hpp:128: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). open(filename, mode); data/libhpptools-1.1.1/include/strict_fstream.hpp:130: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). void open(const std::string& filename, std::ios_base::openmode mode = std::ios_base::in) data/libhpptools-1.1.1/include/strict_fstream.hpp:135:24: [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). std::ifstream::open(filename, mode); data/libhpptools-1.1.1/include/strict_fstream.hpp:148: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). open(filename, mode); data/libhpptools-1.1.1/include/strict_fstream.hpp:150: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). void open(const std::string& filename, std::ios_base::openmode mode = std::ios_base::out) data/libhpptools-1.1.1/include/strict_fstream.hpp:155:24: [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). std::ofstream::open(filename, mode); data/libhpptools-1.1.1/include/strict_fstream.hpp:167: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). open(filename, mode); data/libhpptools-1.1.1/include/strict_fstream.hpp:169: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). void open(const std::string& filename, std::ios_base::openmode mode = std::ios_base::in) data/libhpptools-1.1.1/include/strict_fstream.hpp:174: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). std::fstream::open(filename, mode); data/libhpptools-1.1.1/examples/zc.cpp:20:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(buff, buff_size); data/libhpptools-1.1.1/examples/zpipe.cpp:28:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(buff, buff_size); ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 12931 in approximately 0.44 seconds (29199 lines/second) Physical Source Lines of Code (SLOC) = 9886 Hits@level = [0] 0 [1] 2 [2] 18 [3] 2 [4] 0 [5] 0 Hits@level+ = [0+] 22 [1+] 22 [2+] 20 [3+] 2 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 2.22537 [1+] 2.22537 [2+] 2.02306 [3+] 0.202306 [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.