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/fcitx5-skk-5.0.0/gui/adddictdialog.cpp Examining data/fcitx5-skk-5.0.0/gui/adddictdialog.h Examining data/fcitx5-skk-5.0.0/gui/dictmodel.cpp Examining data/fcitx5-skk-5.0.0/gui/dictmodel.h Examining data/fcitx5-skk-5.0.0/gui/dictwidget.h Examining data/fcitx5-skk-5.0.0/gui/main.cpp Examining data/fcitx5-skk-5.0.0/gui/main.h Examining data/fcitx5-skk-5.0.0/gui/dictwidget.cpp Examining data/fcitx5-skk-5.0.0/src/skk.cpp Examining data/fcitx5-skk-5.0.0/src/skk.h FINAL RESULTS: data/fcitx5-skk-5.0.0/src/skk.cpp:520:21: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. realpath.data(), encoding.data(), nullptr); data/fcitx5-skk-5.0.0/gui/dictmodel.cpp:30:11: [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 (f.open(QIODevice::ReadOnly)) { data/fcitx5-skk-5.0.0/gui/dictmodel.cpp:36:40: [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). auto file = StandardPath::global().open(StandardPath::Type::PkgData, data/fcitx5-skk-5.0.0/gui/dictmodel.cpp:42:12: [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 (!f.open(file.fd(), QIODevice::ReadOnly)) { data/fcitx5-skk-5.0.0/gui/dictmodel.cpp:90:27: [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 (!tempFile.open(fd, QIODevice::WriteOnly)) { data/fcitx5-skk-5.0.0/src/skk.cpp:200:23: [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. constexpr char labels[3][11] = { data/fcitx5-skk-5.0.0/src/skk.cpp:206:13: [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 label[2] = {labels[static_cast<int>( data/fcitx5-skk-5.0.0/src/skk.cpp:428:40: [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). auto file = StandardPath::global().open(StandardPath::Type::PkgData, data/fcitx5-skk-5.0.0/gui/adddictdialog.cpp:85:42: [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). path = dir.filePath(path.mid(strlen(FCITX_CONFIG_DIR) + 1)); data/fcitx5-skk-5.0.0/src/skk.cpp:28:18: [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). size_t len = strlen(preeditString); data/fcitx5-skk-5.0.0/src/skk.cpp:461:40: [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. auto key = token.substr(0, equal); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 1518 in approximately 0.06 seconds (23871 lines/second) Physical Source Lines of Code (SLOC) = 1214 Hits@level = [0] 0 [1] 3 [2] 7 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 11 [1+] 11 [2+] 8 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 9.06096 [1+] 9.06096 [2+] 6.58979 [3+] 0.823723 [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.