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/kcoreaddons-5.74.0/autotests/kfileutilstest.cpp Examining data/kcoreaddons-5.74.0/autotests/alwaysunloadplugin.h Examining data/kcoreaddons-5.74.0/autotests/kpluginloadertest.cpp Examining data/kcoreaddons-5.74.0/autotests/klistopenfilesjobtest_unix.cpp Examining data/kcoreaddons-5.74.0/autotests/kdelibs4configmigratortest.cpp Examining data/kcoreaddons-5.74.0/autotests/jsonplugin2.cpp Examining data/kcoreaddons-5.74.0/autotests/kshareddatacachetest.cpp Examining data/kcoreaddons-5.74.0/autotests/kdelibs4migrationtest.cpp Examining data/kcoreaddons-5.74.0/autotests/kprocesstest_helper.cpp Examining data/kcoreaddons-5.74.0/autotests/klistopenfilesjobtest_win.h Examining data/kcoreaddons-5.74.0/autotests/versionedplugin.h Examining data/kcoreaddons-5.74.0/autotests/kjobtest.h Examining data/kcoreaddons-5.74.0/autotests/jsonplugin2.h Examining data/kcoreaddons-5.74.0/autotests/krandomtest.cpp Examining data/kcoreaddons-5.74.0/autotests/kfileutilstest.h Examining data/kcoreaddons-5.74.0/autotests/kautosavefiletest.cpp Examining data/kcoreaddons-5.74.0/autotests/kmacroexpandertest.cpp Examining data/kcoreaddons-5.74.0/autotests/kformattest.cpp Examining data/kcoreaddons-5.74.0/autotests/multiplugin.h Examining data/kcoreaddons-5.74.0/autotests/kusertest.cpp Examining data/kcoreaddons-5.74.0/autotests/kprocesslisttest.cpp Examining data/kcoreaddons-5.74.0/autotests/kpluginmetadatatest.cpp Examining data/kcoreaddons-5.74.0/autotests/kurlmimedatatest.h Examining data/kcoreaddons-5.74.0/autotests/kpluginfactorytest.cpp Examining data/kcoreaddons-5.74.0/autotests/kstringhandlertest.cpp Examining data/kcoreaddons-5.74.0/autotests/multiplugin.cpp Examining data/kcoreaddons-5.74.0/autotests/kstringhandlertest.h Examining data/kcoreaddons-5.74.0/autotests/kosreleasetest.cpp Examining data/kcoreaddons-5.74.0/autotests/kshelltest.cpp Examining data/kcoreaddons-5.74.0/autotests/kprocesstest_helper.h Examining data/kcoreaddons-5.74.0/autotests/kcompositejobtest.cpp Examining data/kcoreaddons-5.74.0/autotests/desktoptojsontest.cpp Examining data/kcoreaddons-5.74.0/autotests/kprocesslisttest.h Examining data/kcoreaddons-5.74.0/autotests/kcompositejobtest.h Examining data/kcoreaddons-5.74.0/autotests/kurlmimedatatest.cpp Examining data/kcoreaddons-5.74.0/autotests/ktexttohtmltest.h Examining data/kcoreaddons-5.74.0/autotests/versionedplugin.cpp Examining data/kcoreaddons-5.74.0/autotests/ktexttohtmltest.cpp Examining data/kcoreaddons-5.74.0/autotests/kprocesstest.cpp Examining data/kcoreaddons-5.74.0/autotests/alwaysunloadplugin.cpp Examining data/kcoreaddons-5.74.0/autotests/unversionedplugin.cpp Examining data/kcoreaddons-5.74.0/autotests/jsonplugin.h Examining data/kcoreaddons-5.74.0/autotests/klistopenfilesjobtest_win.cpp Examining data/kcoreaddons-5.74.0/autotests/kdirwatch_unittest.cpp Examining data/kcoreaddons-5.74.0/autotests/unversionedplugin.h Examining data/kcoreaddons-5.74.0/autotests/klistopenfilesjobtest_unix.h Examining data/kcoreaddons-5.74.0/autotests/kjobtest.cpp Examining data/kcoreaddons-5.74.0/autotests/kaboutdatatest.cpp Examining data/kcoreaddons-5.74.0/autotests/kformattest.h Examining data/kcoreaddons-5.74.0/autotests/jsonplugin.cpp Examining data/kcoreaddons-5.74.0/autotests/kaboutdataapplicationdatatest.cpp Examining data/kcoreaddons-5.74.0/autotests/kautosavefiletest.h Examining data/kcoreaddons-5.74.0/tests/kdirwatchtest_gui.h Examining data/kcoreaddons-5.74.0/tests/krandomsequencetest.cpp Examining data/kcoreaddons-5.74.0/tests/kdirwatchtest.cpp Examining data/kcoreaddons-5.74.0/tests/kdirwatchtest.h Examining data/kcoreaddons-5.74.0/tests/faceicontest.h Examining data/kcoreaddons-5.74.0/tests/faceicontest.cpp Examining data/kcoreaddons-5.74.0/tests/kdirwatchtest_gui.cpp Examining data/kcoreaddons-5.74.0/src/desktoptojson/desktoptojson.h Examining data/kcoreaddons-5.74.0/src/desktoptojson/desktoptojson.cpp Examining data/kcoreaddons-5.74.0/src/desktoptojson/main.cpp Examining data/kcoreaddons-5.74.0/src/lib/jobs/kcompositejob.cpp Examining data/kcoreaddons-5.74.0/src/lib/jobs/kcompositejob.h Examining data/kcoreaddons-5.74.0/src/lib/jobs/kjobuidelegate.h Examining data/kcoreaddons-5.74.0/src/lib/jobs/kjob_p.h Examining data/kcoreaddons-5.74.0/src/lib/jobs/kjob.cpp Examining data/kcoreaddons-5.74.0/src/lib/jobs/kcompositejob_p.h Examining data/kcoreaddons-5.74.0/src/lib/jobs/kjob.h Examining data/kcoreaddons-5.74.0/src/lib/jobs/kjobtrackerinterface.h Examining data/kcoreaddons-5.74.0/src/lib/jobs/kjobuidelegate.cpp Examining data/kcoreaddons-5.74.0/src/lib/jobs/kjobtrackerinterface.cpp Examining data/kcoreaddons-5.74.0/src/lib/io/kurlmimedata.h Examining data/kcoreaddons-5.74.0/src/lib/io/kbackup.cpp Examining data/kcoreaddons-5.74.0/src/lib/io/kbackup.h Examining data/kcoreaddons-5.74.0/src/lib/io/kurlmimedata.cpp Examining data/kcoreaddons-5.74.0/src/lib/io/kmessage.cpp Examining data/kcoreaddons-5.74.0/src/lib/io/kfileutils.h Examining data/kcoreaddons-5.74.0/src/lib/io/kdirwatch.h Examining data/kcoreaddons-5.74.0/src/lib/io/kdirwatch.cpp Examining data/kcoreaddons-5.74.0/src/lib/io/kfilesystemtype.cpp Examining data/kcoreaddons-5.74.0/src/lib/io/kfilesystemtype.h Examining data/kcoreaddons-5.74.0/src/lib/io/kautosavefile.h Examining data/kcoreaddons-5.74.0/src/lib/io/kmessage.h Examining data/kcoreaddons-5.74.0/src/lib/io/kautosavefile.cpp Examining data/kcoreaddons-5.74.0/src/lib/io/kprocess.h Examining data/kcoreaddons-5.74.0/src/lib/io/kprocess.cpp Examining data/kcoreaddons-5.74.0/src/lib/io/kprocess_p.h Examining data/kcoreaddons-5.74.0/src/lib/io/kdirwatch_p.h Examining data/kcoreaddons-5.74.0/src/lib/io/kfileutils.cpp Examining data/kcoreaddons-5.74.0/src/lib/text/ktexttohtml.cpp Examining data/kcoreaddons-5.74.0/src/lib/text/kmacroexpander_win.cpp Examining data/kcoreaddons-5.74.0/src/lib/text/kmacroexpander_unix.cpp Examining data/kcoreaddons-5.74.0/src/lib/text/ktexttohtml_p.h Examining data/kcoreaddons-5.74.0/src/lib/text/ktexttohtml.h Examining data/kcoreaddons-5.74.0/src/lib/text/kmacroexpander_p.h Examining data/kcoreaddons-5.74.0/src/lib/text/kmacroexpander.cpp Examining data/kcoreaddons-5.74.0/src/lib/text/kstringhandler.cpp Examining data/kcoreaddons-5.74.0/src/lib/text/kstringhandler.h Examining data/kcoreaddons-5.74.0/src/lib/text/kmacroexpander.h Examining data/kcoreaddons-5.74.0/src/lib/text/ktexttohtmlemoticonsinterface.h Examining data/kcoreaddons-5.74.0/src/lib/randomness/krandomsequence.cpp Examining data/kcoreaddons-5.74.0/src/lib/randomness/krandom.cpp Examining data/kcoreaddons-5.74.0/src/lib/randomness/krandomsequence.h Examining data/kcoreaddons-5.74.0/src/lib/randomness/krandom.h Examining data/kcoreaddons-5.74.0/src/lib/util/klistopenfilesjob_win.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kdelibs4configmigrator.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kdelibs4configmigrator.h Examining data/kcoreaddons-5.74.0/src/lib/util/kdelibs4migration.h Examining data/kcoreaddons-5.74.0/src/lib/util/kformat.h Examining data/kcoreaddons-5.74.0/src/lib/util/kformatprivate.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kshell_p.h Examining data/kcoreaddons-5.74.0/src/lib/util/kuser.h Examining data/kcoreaddons-5.74.0/src/lib/util/klistopenfilesjob.h Examining data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_p.h Examining data/kcoreaddons-5.74.0/src/lib/util/kshell_win.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kprocesslist.h Examining data/kcoreaddons-5.74.0/src/lib/util/kshell.h Examining data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_unix_procstat.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kuser_unix.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kformatprivate_p.h Examining data/kcoreaddons-5.74.0/src/lib/util/kosrelease.h Examining data/kcoreaddons-5.74.0/src/lib/util/kformat.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/klistopenfilesjob_unix.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kshell.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kuser_win.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kshell_unix.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kdelibs4migration.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kprocesslist.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_win.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kosrelease.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_unix.cpp Examining data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_unix_procstat_p.h Examining data/kcoreaddons-5.74.0/src/lib/plugin/kpluginfactory_p.h Examining data/kcoreaddons-5.74.0/src/lib/plugin/kpluginfactory.h Examining data/kcoreaddons-5.74.0/src/lib/plugin/kpluginmetadata.cpp Examining data/kcoreaddons-5.74.0/src/lib/plugin/desktopfileparser.cpp Examining data/kcoreaddons-5.74.0/src/lib/plugin/kexportplugin.h Examining data/kcoreaddons-5.74.0/src/lib/plugin/kpluginfactory.cpp Examining data/kcoreaddons-5.74.0/src/lib/plugin/desktopfileparser_p.h Examining data/kcoreaddons-5.74.0/src/lib/plugin/kpluginloader.cpp Examining data/kcoreaddons-5.74.0/src/lib/plugin/kpluginmetadata.h Examining data/kcoreaddons-5.74.0/src/lib/plugin/kpluginloader.h Examining data/kcoreaddons-5.74.0/src/lib/kcoreaddons.cpp Examining data/kcoreaddons-5.74.0/src/lib/kaboutdata.h Examining data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache.h Examining data/kcoreaddons-5.74.0/src/lib/caching/posix_fallocate_mac.h Examining data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache_win.cpp Examining data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache_p.h Examining data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache.cpp Examining data/kcoreaddons-5.74.0/src/lib/kcoreaddons.h Examining data/kcoreaddons-5.74.0/src/lib/kaboutdata.cpp FINAL RESULTS: data/kcoreaddons-5.74.0/autotests/krandomtest.cpp:88:30: [3] (random) random: 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. int testValue = KRandom::random(); data/kcoreaddons-5.74.0/autotests/krandomtest.cpp:221:31: [3] (random) random: 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. std::cout << KRandom::random() << ' '; data/kcoreaddons-5.74.0/autotests/krandomtest.cpp:224:27: [3] (random) random: 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. std::cout << KRandom::random() << '\n'; data/kcoreaddons-5.74.0/src/lib/randomness/krandom.cpp:32:14: [3] (random) random: 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. int KRandom::random() data/kcoreaddons-5.74.0/src/lib/randomness/krandom.h:40:24: [3] (random) random: 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. KCOREADDONS_EXPORT int random(); data/kcoreaddons-5.74.0/tests/kdirwatchtest.cpp:44:28: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. QString home = QString(getenv("HOME")) + '/'; data/kcoreaddons-5.74.0/tests/krandomsequencetest.cpp:51:26: [3] (random) random: 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. seq.setSeed(KRandom::random()); data/kcoreaddons-5.74.0/autotests/desktoptojsontest.cpp:299: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). QVERIFY(inputFile.open()); data/kcoreaddons-5.74.0/autotests/desktoptojsontest.cpp:300: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). QVERIFY(output.open()); // create the file data/kcoreaddons-5.74.0/autotests/desktoptojsontest.cpp:330: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). QVERIFY(output.open()); data/kcoreaddons-5.74.0/autotests/kaboutdatatest.cpp:199:17: [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). licenseFile.open(QIODevice::WriteOnly); data/kcoreaddons-5.74.0/autotests/kautosavefiletest.cpp:37: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). QVERIFY(file.open()); data/kcoreaddons-5.74.0/autotests/kautosavefiletest.cpp:45:22: [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). QVERIFY(saveFile.open(QIODevice::ReadWrite)); data/kcoreaddons-5.74.0/autotests/kautosavefiletest.cpp:59: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). testReader.open(QIODevice::ReadWrite); data/kcoreaddons-5.74.0/autotests/kautosavefiletest.cpp:102:22: [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). QVERIFY(saveFile.open(QIODevice::ReadWrite)); data/kcoreaddons-5.74.0/autotests/kautosavefiletest.cpp:112:22: [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). QVERIFY(saveFile.open(QIODevice::ReadWrite)); data/kcoreaddons-5.74.0/autotests/kautosavefiletest.cpp:133:22: [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). QVERIFY(saveFile.open(QIODevice::ReadWrite)); data/kcoreaddons-5.74.0/autotests/kautosavefiletest.cpp:147:25: [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). QVERIFY(!saveFile2->open(QIODevice::ReadWrite)); data/kcoreaddons-5.74.0/autotests/kautosavefiletest.cpp:151: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). QVERIFY(saveFile2->open(QIODevice::ReadWrite)); data/kcoreaddons-5.74.0/autotests/kdirwatch_unittest.cpp:151: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). QVERIFY(file.open(QIODevice::WriteOnly)); data/kcoreaddons-5.74.0/autotests/kdirwatch_unittest.cpp:251: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). QVERIFY(file.open(QIODevice::Append | QIODevice::WriteOnly)); data/kcoreaddons-5.74.0/autotests/kdirwatch_unittest.cpp:850: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). QVERIFY(file.open(QIODevice::WriteOnly)); data/kcoreaddons-5.74.0/autotests/kfileutilstest.cpp:50:22: [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). QVERIFY(file.open(QIODevice::WriteOnly)); data/kcoreaddons-5.74.0/autotests/klistopenfilesjobtest_unix.cpp:35:22: [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). QVERIFY(tempFile.open(QIODevice::WriteOnly)); data/kcoreaddons-5.74.0/autotests/kpluginmetadatatest.cpp:46:26: [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). QVERIFY(jsonFile.open(QFile::ReadOnly)); data/kcoreaddons-5.74.0/autotests/kprocesstest_helper.cpp:23:69: [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). p.setOutputChannelMode(static_cast<KProcess::OutputChannelMode>(atoi(argv[1]))); data/kcoreaddons-5.74.0/autotests/krandomtest.cpp:235:29: [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). childGenRandom(std::atoi(argv[1])); data/kcoreaddons-5.74.0/autotests/kshareddatacachetest.cpp:48:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(data.data(), "Hello world"); data/kcoreaddons-5.74.0/autotests/kshareddatacachetest.cpp:55:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(data.data(), "Hello KDE"); data/kcoreaddons-5.74.0/src/desktoptojson/desktoptojson.cpp:123: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 | QIODevice::Text)) { data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache.cpp:705:19: [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(destinationPage, sourcePage, cachePageSize()); data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache.cpp:840:11: [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(table, indexTable(), sizeof(IndexTableEntry) * indexTableSize()); data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache.cpp:1050: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 (file.open(QIODevice::ReadWrite) && data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache.cpp:1375:11: [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(startOfData, str.constData(), str.size() + 1); data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache.cpp:1575:11: [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(startOfPageData, encodedKey.constData(), fileNameLength); data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache.cpp:1576:11: [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(startOfPageData + fileNameLength, data.constData(), data.size()); data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache_p.h:349: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 unused[64]; data/kcoreaddons-5.74.0/src/lib/io/kautosavefile.cpp:131:21: [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 KAutoSaveFile::open(OpenMode openmode) data/kcoreaddons-5.74.0/src/lib/io/kautosavefile.cpp:153:16: [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 (QFile::open(openmode)) { data/kcoreaddons-5.74.0/src/lib/io/kautosavefile.h:192: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 openmode) override; data/kcoreaddons-5.74.0/src/lib/io/kdirwatch.cpp:261: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 buf[8192]; data/kcoreaddons-5.74.0/src/lib/io/kdirwatch.cpp:1311: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 outstr[200]; data/kcoreaddons-5.74.0/src/lib/kaboutdata.cpp:303: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 (file.open(QIODevice::ReadOnly)) { data/kcoreaddons-5.74.0/src/lib/plugin/desktopfileparser.cpp:175: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(QFile::ReadOnly)) { data/kcoreaddons-5.74.0/src/lib/plugin/kpluginmetadata.cpp:58: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 b = f.open(QIODevice::ReadOnly); data/kcoreaddons-5.74.0/src/lib/randomness/krandom.cpp:39:31: [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 opened = urandom.open(QIODevice::ReadOnly | QIODevice::Unbuffered); data/kcoreaddons-5.74.0/src/lib/text/kstringhandler.cpp:236:27: [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. static const unsigned char text_chars[256] = { data/kcoreaddons-5.74.0/src/lib/text/ktexttohtml.cpp:427: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 (!pngFile.open(QIODevice::ReadOnly | QIODevice::Unbuffered)) { data/kcoreaddons-5.74.0/src/lib/util/kosrelease.cpp:118: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). file.open(QIODevice::ReadOnly | QIODevice::Text); data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_unix.cpp:86: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::ReadOnly)) data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_unix.cpp:104:17: [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 (cmdFile.open(QFile::ReadOnly)) { data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_unix_procstat_p.h:94:25: [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 pathname[PATH_MAX]; data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_win.cpp:77:13: [2] (buffer) TCHAR: 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. TCHAR user[MAX_PATH] = { 0 }; data/kcoreaddons-5.74.0/src/lib/util/kprocesslist_win.cpp:79:13: [2] (buffer) TCHAR: 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. TCHAR domain[MAX_PATH] = { 0 }; data/kcoreaddons-5.74.0/src/lib/util/kuser_win.cpp:691: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 sidBuffer[SECURITY_MAX_SID_SIZE]; data/kcoreaddons-5.74.0/src/lib/util/kuser_win.cpp:788: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[SECURITY_MAX_SID_SIZE]; data/kcoreaddons-5.74.0/src/lib/caching/kshareddatacache.cpp:1159:17: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(usecSleepTime); // spin data/kcoreaddons-5.74.0/src/lib/io/kdirwatch.cpp:269:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int bytesAvailable = read(m_inotify_fd, &buf[offsetStartRead], bytesToRead); data/kcoreaddons-5.74.0/src/lib/randomness/krandom.cpp:40:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!opened || urandom.read(reinterpret_cast<char *>(&seed), sizeof(seed)) != sizeof(seed)) { ANALYSIS SUMMARY: Hits = 59 Lines analyzed = 31254 in approximately 2.05 seconds (15278 lines/second) Physical Source Lines of Code (SLOC) = 19092 Hits@level = [0] 36 [1] 3 [2] 49 [3] 7 [4] 0 [5] 0 Hits@level+ = [0+] 95 [1+] 59 [2+] 56 [3+] 7 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 4.97591 [1+] 3.0903 [2+] 2.93317 [3+] 0.366646 [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.