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/notepadqq-2.0.0~beta1/src/ui-tests/tst_notepadqqtest.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/EditorNS/bannerbasicmessage.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/EditorNS/bannerfilechanged.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/EditorNS/bannerfileremoved.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/EditorNS/bannerindentationdetected.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/EditorNS/customqwebview.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/EditorNS/editor.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/EditorNS/languageservice.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/Stubs/editorstub.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/Stubs/menuitemstub.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/Stubs/notepadqqstub.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/Stubs/stub.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/Stubs/windowstub.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/extension.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/extensionsloader.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/extensionsserver.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/installextension.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Extensions/runtimesupport.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Search/advancedsearchdock.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Search/filereplacer.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Search/filesearcher.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Search/frmsearchreplace.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Search/searchinstance.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Search/searchobjects.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Search/searchstring.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Sessions/backupservice.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Sessions/persistentcache.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/Sessions/sessions.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/clickablelabel.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/docengine.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/editortabwidget.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/frmabout.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/frmencodingchooser.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/frmindentationmode.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/frmlinenumberchooser.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/frmpreferences.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/globals.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/iconprovider.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/include/EditorNS/bannerbasicmessage.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/EditorNS/bannerfilechanged.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/EditorNS/bannerfileremoved.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/EditorNS/bannerindentationdetected.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/EditorNS/customqwebview.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/EditorNS/editor.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/EditorNS/languageservice.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/Stubs/editorstub.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/Stubs/menuitemstub.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/Stubs/notepadqqstub.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/Stubs/stub.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/Stubs/windowstub.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/extension.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/extensionsloader.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/extensionsserver.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/installextension.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Extensions/runtimesupport.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Search/advancedsearchdock.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Search/filereplacer.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Search/filesearcher.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Search/frmsearchreplace.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Search/searchhelpers.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Search/searchinstance.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Search/searchobjects.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Search/searchstring.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Sessions/backupservice.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Sessions/persistentcache.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/Sessions/sessions.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/clickablelabel.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/docengine.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/editortabwidget.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/frmabout.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/frmencodingchooser.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/frmindentationmode.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/frmlinenumberchooser.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/frmpreferences.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/globals.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/iconprovider.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/keygrabber.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/localcommunication.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/mainwindow.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/notepadqq.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/nqqrun.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/nqqsettings.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/singleapplication.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/stats.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/svgiconengine.h Examining data/notepadqq-2.0.0~beta1/src/ui/include/topeditorcontainer.h Examining data/notepadqq-2.0.0~beta1/src/ui/keygrabber.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/src/qtpromise/qpromise.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/src/qtpromise/qpromise_p.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/src/qtpromise/qpromiseconnections.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/src/qtpromise/qpromiseexceptions.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/src/qtpromise/qpromisefuture.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/src/qtpromise/qpromiseglobal.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/src/qtpromise/qpromisehelpers.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/src/qtpromise/qpromisehelpers_p.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/src/qtpromise/qpromiseresolver.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/benchmark/tst_benchmark.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/deprecations/helpers/qpromise/tst_qpromise.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/deprecations/helpers/qpromiseall/tst_qpromiseall.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/deprecations/qpromise/all/tst_all.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/exceptions/tst_exceptions.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/future/tst_future.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/helpers/all/tst_all.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/helpers/attempt/tst_attempt.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/helpers/connect/tst_connect.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/helpers/each/tst_each.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/helpers/filter/tst_filter.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/helpers/map/tst_map.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/helpers/reduce/tst_reduce.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/helpers/reject/tst_reject.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/helpers/resolve/tst_resolve.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/construct/tst_construct.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/delay/tst_delay.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/each/tst_each.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/fail/tst_fail.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/filter/tst_filter.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/finally/tst_finally.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/map/tst_map.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/operators/tst_operators.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/reduce/tst_reduce.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/resolve/tst_resolve.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/tap/tst_tap.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/tapfail/tst_tapfail.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/then/tst_then.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromise/timeout/tst_timeout.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/qpromiseconnections/tst_qpromiseconnections.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/requirements/tst_requirements.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/shared/data.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/shared/object.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/shared/utils.h Examining data/notepadqq-2.0.0~beta1/src/ui/libs/qtpromise/tests/auto/qtpromise/thread/tst_thread.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/localcommunication.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/main.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/mainwindow.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/notepadqq.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/nqqrun.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/nqqsettings.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/singleapplication.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/stats.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/svgiconengine.cpp Examining data/notepadqq-2.0.0~beta1/src/ui/topeditorcontainer.cpp FINAL RESULTS: data/notepadqq-2.0.0~beta1/src/ui/Extensions/Stubs/stub.cpp:119:36: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (metaMethod.access() != QMetaMethod::Public) data/notepadqq-2.0.0~beta1/src/ui/EditorNS/languageservice.cpp:18: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). scriptFile.open(QIODevice::ReadOnly | QIODevice::Text); data/notepadqq-2.0.0~beta1/src/ui/Extensions/extension.cpp:77: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 (fManifest.open(QFile::ReadOnly | QFile::Text)) { data/notepadqq-2.0.0~beta1/src/ui/Search/filereplacer.cpp:110:9: [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(uc + i, chunk.unicode(), static_cast<ulong>(len) * sizeof(QChar)); data/notepadqq-2.0.0~beta1/src/ui/Sessions/sessions.cpp:353: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). file.open(QIODevice::WriteOnly); data/notepadqq-2.0.0~beta1/src/ui/Sessions/sessions.cpp:369: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). file.open(QIODevice::ReadOnly); data/notepadqq-2.0.0~beta1/src/ui/docengine.cpp:55: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/notepadqq-2.0.0~beta1/src/ui/docengine.cpp:759: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 (!io->open(QIODevice::WriteOnly)) data/notepadqq-2.0.0~beta1/src/ui/mainwindow.cpp:2281: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). if (file.open(QIODevice::WriteOnly)) { // FIXME: Delete the file when we're done data/notepadqq-2.0.0~beta1/src/ui/svgiconengine.cpp:18: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/notepadqq-2.0.0~beta1/src/ui/docengine.cpp:71:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). QPromise<void> DocEngine::read(QFile *file, QSharedPointer<Editor> editor) data/notepadqq-2.0.0~beta1/src/ui/docengine.cpp:73:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(file, editor, nullptr, false); data/notepadqq-2.0.0~beta1/src/ui/docengine.cpp:76:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). QPromise<void> DocEngine::read(QFile *file, QSharedPointer<Editor> editor, QTextCodec *codec, bool bom) data/notepadqq-2.0.0~beta1/src/ui/docengine.cpp:286:55: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). QPromise<void> readResult = this->read(&file, editor, codec, bom).wait(); data/notepadqq-2.0.0~beta1/src/ui/docengine.cpp:300:48: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). readResult = this->read(&file, editor, codec, bom).wait(); data/notepadqq-2.0.0~beta1/src/ui/docengine.cpp:473:47: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). QPromise<void> readResult = this->read(&file, editor, codec, bom).wait(); // FIXME To async! data/notepadqq-2.0.0~beta1/src/ui/docengine.cpp:490:40: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). readResult = this->read(&file, editor, codec, bom).wait(); // FIXME To async! data/notepadqq-2.0.0~beta1/src/ui/include/docengine.h:202:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). QPromise<void> read(QFile *file, QSharedPointer<Editor> editor); data/notepadqq-2.0.0~beta1/src/ui/include/docengine.h:203:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). QPromise<void> read(QFile *file, QSharedPointer<Editor> editor, QTextCodec *codec, bool bom); data/notepadqq-2.0.0~beta1/src/ui/localcommunication.cpp:45:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). header.append(socket->read(bytes - header.length())); data/notepadqq-2.0.0~beta1/src/ui/localcommunication.cpp:58:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). msgData.append(socket->read(size - msgData.length())); data/notepadqq-2.0.0~beta1/src/ui/nqqsettings.cpp:69:43: [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). QString actionName = key.mid( strlen("Shortcuts/")); ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 24133 in approximately 0.63 seconds (38138 lines/second) Physical Source Lines of Code (SLOC) = 17635 Hits@level = [0] 0 [1] 12 [2] 9 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 22 [1+] 22 [2+] 10 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 1.24752 [1+] 1.24752 [2+] 0.567054 [3+] 0.0567054 [4+] 0.0567054 [5+] 0 Dot directories skipped = 4 (--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.