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/pcg-cpp-0.98.1/include/pcg_extras.hpp Examining data/pcg-cpp-0.98.1/include/pcg_random.hpp Examining data/pcg-cpp-0.98.1/include/pcg_uint128.hpp Examining data/pcg-cpp-0.98.1/sample/codebook.cpp Examining data/pcg-cpp-0.98.1/sample/cppref-sample.cpp Examining data/pcg-cpp-0.98.1/sample/make-partytrick.cpp Examining data/pcg-cpp-0.98.1/sample/pcg-demo.cpp Examining data/pcg-cpp-0.98.1/sample/spew.cpp Examining data/pcg-cpp-0.98.1/sample/use-partytrick.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg128_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg128_oneseq_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg16_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg16_oneseq_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_c1024.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_c1024_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_c64.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_c64_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_c64_oneseq.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_k1024.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_k1024_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_k16384.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_k16384_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_k2.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_k2_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_k64.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_k64_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_k64_oneseq.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_oneseq.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_oneseq_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg32_unique.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_c1024.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_c1024_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_c32.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_c32_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_c32_oneseq.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_k1024.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_k1024_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_k32.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_k32_fast.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_k32_oneseq.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_oneseq.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_oneseq_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg64_unique.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg8_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/check-pcg8_oneseq_once_insecure.cpp Examining data/pcg-cpp-0.98.1/test-high/pcg-test-noadvance.cpp Examining data/pcg-cpp-0.98.1/test-high/pcg-test.cpp FINAL RESULTS: data/pcg-cpp-0.98.1/include/pcg_extras.hpp:197:12: [3] (random) setstate: 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. in.setstate(std::ios::failbit); data/pcg-cpp-0.98.1/include/pcg_extras.hpp:230:12: [3] (random) setstate: 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. in.setstate(std::ios::failbit); data/pcg-cpp-0.98.1/include/pcg_extras.hpp:153: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[MAX_CHARS_128BIT]; data/pcg-cpp-0.98.1/sample/pcg-demo.cpp:71:18: [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). rounds = atoi(argv[0]); data/pcg-cpp-0.98.1/sample/pcg-demo.cpp:153: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 cards[CARDS]; data/pcg-cpp-0.98.1/test-high/pcg-test-noadvance.cpp:73:18: [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). rounds = atoi(argv[0]); data/pcg-cpp-0.98.1/test-high/pcg-test-noadvance.cpp:140: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 cards[CARDS]; data/pcg-cpp-0.98.1/test-high/pcg-test.cpp:73:18: [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). rounds = atoi(argv[0]); data/pcg-cpp-0.98.1/test-high/pcg-test.cpp:152: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 cards[CARDS]; data/pcg-cpp-0.98.1/include/pcg_random.hpp:1365:18: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. && !std::equal( ANALYSIS SUMMARY: Hits = 10 Lines analyzed = 4273 in approximately 0.12 seconds (34265 lines/second) Physical Source Lines of Code (SLOC) = 2752 Hits@level = [0] 11 [1] 1 [2] 7 [3] 2 [4] 0 [5] 0 Hits@level+ = [0+] 21 [1+] 10 [2+] 9 [3+] 2 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 7.63081 [1+] 3.63372 [2+] 3.27035 [3+] 0.726744 [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.