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/kdocker-5.3/3rdparty/qtsingleapplication/examples/console/main.cpp Examining data/kdocker-5.3/3rdparty/qtsingleapplication/examples/loader/main.cpp Examining data/kdocker-5.3/3rdparty/qtsingleapplication/examples/trivial/main.cpp Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlocalpeer.cpp Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlocalpeer.h Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlockedfile.cpp Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlockedfile.h Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlockedfile_unix.cpp Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlockedfile_win.cpp Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtsingleapplication.cpp Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtsingleapplication.h Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtsinglecoreapplication.cpp Examining data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtsinglecoreapplication.h Examining data/kdocker-5.3/src/application.cpp Examining data/kdocker-5.3/src/application.h Examining data/kdocker-5.3/src/constants.cpp Examining data/kdocker-5.3/src/constants.h Examining data/kdocker-5.3/src/kdocker.cpp Examining data/kdocker-5.3/src/kdocker.h Examining data/kdocker-5.3/src/main.cpp Examining data/kdocker-5.3/src/scanner.cpp Examining data/kdocker-5.3/src/scanner.h Examining data/kdocker-5.3/src/trayitem.cpp Examining data/kdocker-5.3/src/trayitem.h Examining data/kdocker-5.3/src/trayitemmanager.cpp Examining data/kdocker-5.3/src/trayitemmanager.h Examining data/kdocker-5.3/src/xlibutil.cpp Examining data/kdocker-5.3/src/xlibutil.h FINAL RESULTS: data/kdocker-5.3/src/main.cpp:51:30: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. translator.load(QLocale::system().name(), ":/i18n"); data/kdocker-5.3/src/kdocker.cpp:78:22: [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 ((option = getopt(argc, argv, Constants::OPTIONSTRING)) != -1) { data/kdocker-5.3/src/trayitemmanager.cpp:177:22: [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 ((option = getopt(argc, const_cast<char **> (argv), Constants::OPTIONSTRING)) != -1) { data/kdocker-5.3/3rdparty/qtsingleapplication/examples/loader/main.cpp:96: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). if (file.open(QIODevice::ReadOnly)) data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlocalpeer.cpp:108: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). lockFile.open(QIODevice::ReadWrite); data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlockedfile.cpp:123:20: [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). bool QtLockedFile::open(OpenMode mode) data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlockedfile.cpp:129: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). return QFile::open(mode); data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlockedfile.h:76: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). bool open(OpenMode mode); data/kdocker-5.3/src/trayitemmanager.cpp:168:11: [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. const char *argv[argc + 1]; data/kdocker-5.3/src/trayitemmanager.cpp:186:27: [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). maxTime = atoi(optarg); data/kdocker-5.3/src/trayitemmanager.cpp:238:44: [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). settings.iBalloonTimeout = atoi(optarg) * 1000; // convert to ms data/kdocker-5.3/src/trayitemmanager.cpp:256:50: [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). window = static_cast<Window>(atoi(optarg)); data/kdocker-5.3/src/trayitemmanager.cpp:265:23: [2] (integer) atol: 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). pid = atol(optarg); data/kdocker-5.3/src/xlibutil.cpp:249: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((char *) & ev.xclient.data, (const char *) data, size); data/kdocker-5.3/3rdparty/qtsingleapplication/src/qtlocalpeer.cpp:167:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). res &= (socket.read(qstrlen(ack)) == ack); ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 4603 in approximately 0.15 seconds (30559 lines/second) Physical Source Lines of Code (SLOC) = 2640 Hits@level = [0] 1 [1] 1 [2] 11 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 16 [1+] 15 [2+] 14 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 6.06061 [1+] 5.68182 [2+] 5.30303 [3+] 1.13636 [4+] 0.378788 [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.