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/ktnef-20.08.2/autotests/parsertest.h Examining data/ktnef-20.08.2/autotests/parsertest.cpp Examining data/ktnef-20.08.2/src/lzfu.h Examining data/ktnef-20.08.2/src/ktnefwriter.cpp Examining data/ktnef-20.08.2/src/formatter.cpp Examining data/ktnef-20.08.2/src/ktnefpropertyset.cpp Examining data/ktnef-20.08.2/src/ktnefpropertyset.h Examining data/ktnef-20.08.2/src/ktnefmessage.h Examining data/ktnef-20.08.2/src/ktnefdefs.h Examining data/ktnef-20.08.2/src/ktnefmessage.cpp Examining data/ktnef-20.08.2/src/lzfu.cpp Examining data/ktnef-20.08.2/src/mapi.cpp Examining data/ktnef-20.08.2/src/ktnefparser.h Examining data/ktnef-20.08.2/src/formatter.h Examining data/ktnef-20.08.2/src/ktnefattach.h Examining data/ktnef-20.08.2/src/ktnefparser.cpp Examining data/ktnef-20.08.2/src/ktnefattach.cpp Examining data/ktnef-20.08.2/src/ktnefproperty.cpp Examining data/ktnef-20.08.2/src/mapi.h Examining data/ktnef-20.08.2/src/ktnefwriter.h Examining data/ktnef-20.08.2/src/ktnefproperty.h FINAL RESULTS: data/ktnef-20.08.2/src/ktnefmessage.cpp:102:19: [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). if (input.open(QIODevice::ReadOnly) && data/ktnef-20.08.2/src/ktnefmessage.cpp:103: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). output.open(QIODevice::WriteOnly)) { data/ktnef-20.08.2/src/ktnefparser.cpp:392: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). if (!device_->open(QIODevice::ReadOnly)) { data/ktnef-20.08.2/src/ktnefparser.cpp:489:18: [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). if (!outfile.open(QIODevice::WriteOnly)) { data/ktnef-20.08.2/src/ktnefwriter.cpp:319:15: [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). if (!file.open(QIODevice::WriteOnly)) { data/ktnef-20.08.2/src/lzfu.cpp:64:14: [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 window[4096]; data/ktnef-20.08.2/src/lzfu.cpp:72: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(window, LZFU_INITDICT, LZFU_INITLENGTH); data/ktnef-20.08.2/src/ktnefparser.cpp:498:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = device_->read(buf, qMin(sz, len)); data/ktnef-20.08.2/src/ktnefparser.cpp:587:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). device_->read(buffer.data(), buffer.size()); data/ktnef-20.08.2/src/lzfu.cpp:74:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (input->read((char *)&lzfuhdr, sizeof(lzfuhdr)) != sizeof(lzfuhdr)) { data/ktnef-20.08.2/src/lzfu.cpp:88:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (input->read(&bFlags, 1) != 1) { data/ktnef-20.08.2/src/lzfu.cpp:105:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (input->read(&c1, 1) != 1 || input->read(&c2, 1) != 1) { data/ktnef-20.08.2/src/lzfu.cpp:105:56: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (input->read(&c1, 1) != 1 || input->read(&c2, 1) != 1) { ANALYSIS SUMMARY: Hits = 13 Lines analyzed = 4602 in approximately 0.23 seconds (19821 lines/second) Physical Source Lines of Code (SLOC) = 2974 Hits@level = [0] 18 [1] 6 [2] 7 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 31 [1+] 13 [2+] 7 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 10.4237 [1+] 4.37122 [2+] 2.35373 [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.