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/brlaser-6/src/block.h Examining data/brlaser-6/src/brdecode.cc Examining data/brlaser-6/src/debug.cc Examining data/brlaser-6/src/debug.h Examining data/brlaser-6/src/job.cc Examining data/brlaser-6/src/job.h Examining data/brlaser-6/src/line.cc Examining data/brlaser-6/src/line.h Examining data/brlaser-6/src/main.cc Examining data/brlaser-6/test/lest.hpp Examining data/brlaser-6/test/tempfile.h Examining data/brlaser-6/test/test_block.cc Examining data/brlaser-6/test/test_lest.cc Examining data/brlaser-6/test/test_line.cc FINAL RESULTS: data/brlaser-6/src/brdecode.cc:192:15: [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). in_file = fopen(in_filename, "rb"); data/brlaser-6/src/brdecode.cc:210:24: [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 *out_file = fopen(out_filename.c_str(), "wb"); data/brlaser-6/src/main.cc:153: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). fd = open(job_filename, O_RDONLY | O_BINARY); data/brlaser-6/src/brdecode.cc:52:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int ch = getc(in_file); data/brlaser-6/src/brdecode.cc:145:16: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = getc(in_file)) >= 0) { data/brlaser-6/src/line.cc:84:27: [1] (buffer) mismatch: 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. auto mismatch_it = std::mismatch(*first1, last1, *first2); data/brlaser-6/src/line.cc:97:33: [1] (buffer) mismatch: 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. return std::distance(first, mismatch); data/brlaser-6/src/line.cc:149:10: [1] (buffer) mismatch: 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::mismatch(line.rbegin(), line.rend(), reference.rbegin()).first.base(); ANALYSIS SUMMARY: Hits = 8 Lines analyzed = 1831 in approximately 0.13 seconds (14638 lines/second) Physical Source Lines of Code (SLOC) = 1314 Hits@level = [0] 36 [1] 5 [2] 3 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 44 [1+] 8 [2+] 3 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 33.4855 [1+] 6.08828 [2+] 2.28311 [3+] 0 [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.