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/gnote-3.38.0/src/remotecontrolproxy.hpp Examining data/gnote-3.38.0/src/debug.cpp Examining data/gnote-3.38.0/src/addininfo.cpp Examining data/gnote-3.38.0/src/gnote.hpp Examining data/gnote-3.38.0/src/popoverwidgets.hpp Examining data/gnote-3.38.0/src/notebase.cpp Examining data/gnote-3.38.0/src/watchers.cpp Examining data/gnote-3.38.0/src/notetag.hpp Examining data/gnote-3.38.0/src/applicationaddin.cpp Examining data/gnote-3.38.0/src/noteaddin.cpp Examining data/gnote-3.38.0/src/noncopyable.hpp Examining data/gnote-3.38.0/src/sharp/streamwriter.cpp Examining data/gnote-3.38.0/src/sharp/directory.cpp Examining data/gnote-3.38.0/src/sharp/datetime.cpp Examining data/gnote-3.38.0/src/sharp/xmlconvert.hpp Examining data/gnote-3.38.0/src/sharp/fileinfo.cpp Examining data/gnote-3.38.0/src/sharp/dynamicmodule.cpp Examining data/gnote-3.38.0/src/sharp/addinstreemodel.cpp Examining data/gnote-3.38.0/src/sharp/uri.cpp Examining data/gnote-3.38.0/src/sharp/xmlresolver.hpp Examining data/gnote-3.38.0/src/sharp/dynamicmodule.hpp Examining data/gnote-3.38.0/src/sharp/propertyeditor.cpp Examining data/gnote-3.38.0/src/sharp/addinstreemodel.hpp Examining data/gnote-3.38.0/src/sharp/datetime.hpp Examining data/gnote-3.38.0/src/sharp/string.cpp Examining data/gnote-3.38.0/src/sharp/process.hpp Examining data/gnote-3.38.0/src/sharp/fileinfo.hpp Examining data/gnote-3.38.0/src/sharp/modulefactory.hpp Examining data/gnote-3.38.0/src/sharp/xsltargumentlist.cpp Examining data/gnote-3.38.0/src/sharp/xsltargumentlist.hpp Examining data/gnote-3.38.0/src/sharp/timespan.cpp Examining data/gnote-3.38.0/src/sharp/xmlreader.hpp Examining data/gnote-3.38.0/src/sharp/xml.cpp Examining data/gnote-3.38.0/src/sharp/uri.hpp Examining data/gnote-3.38.0/src/sharp/timespan.hpp Examining data/gnote-3.38.0/src/sharp/xsltransform.cpp Examining data/gnote-3.38.0/src/sharp/streamreader.cpp Examining data/gnote-3.38.0/src/sharp/exception.hpp Examining data/gnote-3.38.0/src/sharp/xsltransform.hpp Examining data/gnote-3.38.0/src/sharp/exception.cpp Examining data/gnote-3.38.0/src/sharp/string.hpp Examining data/gnote-3.38.0/src/sharp/map.hpp Examining data/gnote-3.38.0/src/sharp/streamreader.hpp Examining data/gnote-3.38.0/src/sharp/streamwriter.hpp Examining data/gnote-3.38.0/src/sharp/propertyeditor.hpp Examining data/gnote-3.38.0/src/sharp/xml.hpp Examining data/gnote-3.38.0/src/sharp/uuid.hpp Examining data/gnote-3.38.0/src/sharp/process.cpp Examining data/gnote-3.38.0/src/sharp/xmlwriter.cpp Examining data/gnote-3.38.0/src/sharp/modulemanager.hpp Examining data/gnote-3.38.0/src/sharp/xmlreader.cpp Examining data/gnote-3.38.0/src/sharp/xmlconvert.cpp Examining data/gnote-3.38.0/src/sharp/xmlwriter.hpp Examining data/gnote-3.38.0/src/sharp/files.hpp Examining data/gnote-3.38.0/src/sharp/directory.hpp Examining data/gnote-3.38.0/src/sharp/files.cpp Examining data/gnote-3.38.0/src/sharp/modulemanager.cpp Examining data/gnote-3.38.0/src/gnome_keyring/keyringexception.hpp Examining data/gnote-3.38.0/src/gnome_keyring/ring.cpp Examining data/gnote-3.38.0/src/gnome_keyring/ring.hpp Examining data/gnote-3.38.0/src/actionmanager.hpp Examining data/gnote-3.38.0/src/recenttreeview.hpp Examining data/gnote-3.38.0/src/mainwindowaction.hpp Examining data/gnote-3.38.0/src/search.hpp Examining data/gnote-3.38.0/src/importaddin.hpp Examining data/gnote-3.38.0/src/iconmanager.cpp Examining data/gnote-3.38.0/src/mainwindowembeds.hpp Examining data/gnote-3.38.0/src/notebuffer.cpp Examining data/gnote-3.38.0/src/noterenamedialog.hpp Examining data/gnote-3.38.0/src/notemanager.hpp Examining data/gnote-3.38.0/src/test/testsyncaddin.cpp Examining data/gnote-3.38.0/src/test/testsyncmanager.cpp Examining data/gnote-3.38.0/src/test/testtagmanager.cpp Examining data/gnote-3.38.0/src/test/testnote.cpp Examining data/gnote-3.38.0/src/test/testtagmanager.hpp Examining data/gnote-3.38.0/src/test/testnotemanager.cpp Examining data/gnote-3.38.0/src/test/testnotemanager.hpp Examining data/gnote-3.38.0/src/test/testgnote.cpp Examining data/gnote-3.38.0/src/test/runner.cpp Examining data/gnote-3.38.0/src/test/testsyncmanager.hpp Examining data/gnote-3.38.0/src/test/unit/stringutests.cpp Examining data/gnote-3.38.0/src/test/unit/noteutests.cpp Examining data/gnote-3.38.0/src/test/unit/notemanagerutests.cpp Examining data/gnote-3.38.0/src/test/unit/uriutests.cpp Examining data/gnote-3.38.0/src/test/unit/fileinfoutests.cpp Examining data/gnote-3.38.0/src/test/unit/syncmanagerutests.cpp Examining data/gnote-3.38.0/src/test/unit/filesutests.cpp Examining data/gnote-3.38.0/src/test/unit/datetimeutests.cpp Examining data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp Examining data/gnote-3.38.0/src/test/unit/gnotesyncclientutests.cpp Examining data/gnote-3.38.0/src/test/unit/utiltests.cpp Examining data/gnote-3.38.0/src/test/unit/directorytests.cpp Examining data/gnote-3.38.0/src/test/unit/trieutests.cpp Examining data/gnote-3.38.0/src/test/testsyncclient.cpp Examining data/gnote-3.38.0/src/test/testsyncaddin.hpp Examining data/gnote-3.38.0/src/test/testgnote.hpp Examining data/gnote-3.38.0/src/test/testnote.hpp Examining data/gnote-3.38.0/src/test/testsyncclient.hpp Examining data/gnote-3.38.0/src/mainwindowembeds.cpp Examining data/gnote-3.38.0/src/notemanagerbase.cpp Examining data/gnote-3.38.0/src/applicationaddin.hpp Examining data/gnote-3.38.0/src/noteeditor.cpp Examining data/gnote-3.38.0/src/notemanagerbase.hpp Examining data/gnote-3.38.0/src/tag.cpp Examining data/gnote-3.38.0/src/actionmanager.cpp Examining data/gnote-3.38.0/src/addins/todo/todonoteaddin.hpp Examining data/gnote-3.38.0/src/addins/todo/todonoteaddin.cpp Examining data/gnote-3.38.0/src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp Examining data/gnote-3.38.0/src/addins/stickynoteimport/stickynoteimportnoteaddin.hpp Examining data/gnote-3.38.0/src/addins/underline/underlinetag.hpp Examining data/gnote-3.38.0/src/addins/underline/underlinenoteaddin.hpp Examining data/gnote-3.38.0/src/addins/underline/underlinenoteaddin.cpp Examining data/gnote-3.38.0/src/addins/notedirectorywatcher/notedirectorywatcherapplicationaddin.hpp Examining data/gnote-3.38.0/src/addins/notedirectorywatcher/notedirectorywatcherapplicationaddin.cpp Examining data/gnote-3.38.0/src/addins/notedirectorywatcher/notedirectorywatcherpreferences.cpp Examining data/gnote-3.38.0/src/addins/notedirectorywatcher/notedirectorywatcherpreferencesfactory.hpp Examining data/gnote-3.38.0/src/addins/notedirectorywatcher/notedirectorywatcherpreferences.hpp Examining data/gnote-3.38.0/src/addins/readonly/readonlynoteaddin.cpp Examining data/gnote-3.38.0/src/addins/readonly/readonlynoteaddin.hpp Examining data/gnote-3.38.0/src/addins/specialnotes/specialnotesapplicationaddin.hpp Examining data/gnote-3.38.0/src/addins/specialnotes/specialnotesapplicationaddin.cpp Examining data/gnote-3.38.0/src/addins/inserttimestamp/inserttimestamppreferencesfactory.hpp Examining data/gnote-3.38.0/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp Examining data/gnote-3.38.0/src/addins/inserttimestamp/inserttimestampnoteaddin.hpp Examining data/gnote-3.38.0/src/addins/inserttimestamp/inserttimestamppreferences.cpp Examining data/gnote-3.38.0/src/addins/inserttimestamp/inserttimestamppreferences.hpp Examining data/gnote-3.38.0/src/addins/bugzilla/insertbugaction.cpp Examining data/gnote-3.38.0/src/addins/bugzilla/bugzillanoteaddin.hpp Examining data/gnote-3.38.0/src/addins/bugzilla/bugzillanoteaddin.cpp Examining data/gnote-3.38.0/src/addins/bugzilla/insertbugaction.hpp Examining data/gnote-3.38.0/src/addins/bugzilla/bugzillapreferencesfactory.hpp Examining data/gnote-3.38.0/src/addins/bugzilla/bugzillapreferences.cpp Examining data/gnote-3.38.0/src/addins/bugzilla/bugzillalink.cpp Examining data/gnote-3.38.0/src/addins/bugzilla/bugzillalink.hpp Examining data/gnote-3.38.0/src/addins/bugzilla/bugzillapreferences.hpp Examining data/gnote-3.38.0/src/addins/statistics/statisticswidget.cpp Examining data/gnote-3.38.0/src/addins/statistics/statisticsapplicationaddin.hpp Examining data/gnote-3.38.0/src/addins/statistics/statisticsapplicationaddin.cpp Examining data/gnote-3.38.0/src/addins/statistics/statisticswidget.hpp Examining data/gnote-3.38.0/src/addins/gvfssyncservice/gvfssyncserviceaddin.cpp Examining data/gnote-3.38.0/src/addins/gvfssyncservice/gvfssyncserviceaddin.hpp Examining data/gnote-3.38.0/src/addins/exporttogtg/exporttogtgnoteaddin.hpp Examining data/gnote-3.38.0/src/addins/exporttogtg/exporttogtgnoteaddin.cpp Examining data/gnote-3.38.0/src/addins/webdavsyncservice/webdavsyncserviceaddin.cpp Examining data/gnote-3.38.0/src/addins/webdavsyncservice/webdavsyncserviceaddin.hpp Examining data/gnote-3.38.0/src/addins/fixedwidth/fixedwidthnoteaddin.hpp Examining data/gnote-3.38.0/src/addins/fixedwidth/fixedwidthtag.hpp Examining data/gnote-3.38.0/src/addins/fixedwidth/fixedwidthnoteaddin.cpp Examining data/gnote-3.38.0/src/addins/backlinks/backlinksnoteaddin.cpp Examining data/gnote-3.38.0/src/addins/backlinks/backlinksnoteaddin.hpp Examining data/gnote-3.38.0/src/addins/exporttohtml/exporttohtmlnoteaddin.cpp Examining data/gnote-3.38.0/src/addins/exporttohtml/exporttohtmldialog.hpp Examining data/gnote-3.38.0/src/addins/exporttohtml/exporttohtmlnoteaddin.hpp Examining data/gnote-3.38.0/src/addins/exporttohtml/exporttohtmldialog.cpp Examining data/gnote-3.38.0/src/addins/exporttohtml/notenameresolver.hpp Examining data/gnote-3.38.0/src/addins/tableofcontents/tableofcontentsnoteaddin.hpp Examining data/gnote-3.38.0/src/addins/tableofcontents/tableofcontentsmenuitem.hpp Examining data/gnote-3.38.0/src/addins/tableofcontents/tableofcontentsnoteaddin.cpp Examining data/gnote-3.38.0/src/addins/tableofcontents/tableofcontents.hpp Examining data/gnote-3.38.0/src/addins/tableofcontents/tableofcontentsutils.hpp Examining data/gnote-3.38.0/src/addins/tableofcontents/tableofcontentsutils.cpp Examining data/gnote-3.38.0/src/addins/tableofcontents/tableofcontentsmenuitem.cpp Examining data/gnote-3.38.0/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.hpp Examining data/gnote-3.38.0/src/addins/filesystemsyncservice/filesystemsyncserviceaddin.cpp Examining data/gnote-3.38.0/src/addins/replacetitle/replacetitlenoteaddin.hpp Examining data/gnote-3.38.0/src/addins/replacetitle/replacetitlenoteaddin.cpp Examining data/gnote-3.38.0/src/addins/tomboyimport/tomboyimportaddin.hpp Examining data/gnote-3.38.0/src/addins/tomboyimport/tomboyimportaddin.cpp Examining data/gnote-3.38.0/src/addins/printnotes/printnotesnoteaddin.hpp Examining data/gnote-3.38.0/src/addins/printnotes/printnotesnoteaddin.cpp Examining data/gnote-3.38.0/src/addins/noteoftheday/noteoftheday.cpp Examining data/gnote-3.38.0/src/addins/noteoftheday/noteofthedayapplicationaddin.hpp Examining data/gnote-3.38.0/src/addins/noteoftheday/noteofthedaypreferencesfactory.hpp Examining data/gnote-3.38.0/src/addins/noteoftheday/noteofthedaypreferences.hpp Examining data/gnote-3.38.0/src/addins/noteoftheday/noteoftheday.hpp Examining data/gnote-3.38.0/src/addins/noteoftheday/noteofthedaypreferences.cpp Examining data/gnote-3.38.0/src/addins/noteoftheday/noteofthedayapplicationaddin.cpp Examining data/gnote-3.38.0/src/main.cpp Examining data/gnote-3.38.0/src/addininfo.hpp Examining data/gnote-3.38.0/src/triehit.hpp Examining data/gnote-3.38.0/src/addinpreferencefactory.hpp Examining data/gnote-3.38.0/src/addinmanager.hpp Examining data/gnote-3.38.0/src/dbus/searchprovider.cpp Examining data/gnote-3.38.0/src/dbus/remotecontrol-client-glue.hpp Examining data/gnote-3.38.0/src/dbus/remotecontrol-glue.hpp Examining data/gnote-3.38.0/src/dbus/searchprovider.hpp Examining data/gnote-3.38.0/src/dbus/remotecontrol-glue.cpp Examining data/gnote-3.38.0/src/dbus/remotecontrol.hpp Examining data/gnote-3.38.0/src/dbus/remotecontrolclient.hpp Examining data/gnote-3.38.0/src/dbus/remotecontrol.cpp Examining data/gnote-3.38.0/src/dbus/iremotecontrol.hpp Examining data/gnote-3.38.0/src/dbus/remotecontrolclient.cpp Examining data/gnote-3.38.0/src/dbus/remotecontrol-client-glue.cpp Examining data/gnote-3.38.0/src/ignote.hpp Examining data/gnote-3.38.0/src/notewindow.hpp Examining data/gnote-3.38.0/src/addinpreferencefactory.cpp Examining data/gnote-3.38.0/src/importaddin.cpp Examining data/gnote-3.38.0/src/noteeditor.hpp Examining data/gnote-3.38.0/src/recentchanges.cpp Examining data/gnote-3.38.0/src/preferencesdialog.cpp Examining data/gnote-3.38.0/src/note.cpp Examining data/gnote-3.38.0/src/preferencesdialog.hpp Examining data/gnote-3.38.0/src/iactionmanager.hpp Examining data/gnote-3.38.0/src/ignote.cpp Examining data/gnote-3.38.0/src/base/macros.hpp Examining data/gnote-3.38.0/src/notebase.hpp Examining data/gnote-3.38.0/src/noteaddin.hpp Examining data/gnote-3.38.0/src/itagmanager.hpp Examining data/gnote-3.38.0/src/preferencetabaddin.hpp Examining data/gnote-3.38.0/src/notemanager.cpp Examining data/gnote-3.38.0/src/utils.cpp Examining data/gnote-3.38.0/src/trie.hpp Examining data/gnote-3.38.0/src/popoverwidgets.cpp Examining data/gnote-3.38.0/src/notebuffer.hpp Examining data/gnote-3.38.0/src/search.cpp Examining data/gnote-3.38.0/src/notewindow.cpp Examining data/gnote-3.38.0/src/iactionmanager.cpp Examining data/gnote-3.38.0/src/watchers.hpp Examining data/gnote-3.38.0/src/synchronization/syncutils.cpp Examining data/gnote-3.38.0/src/synchronization/silentui.hpp Examining data/gnote-3.38.0/src/synchronization/gnotesyncclient.cpp Examining data/gnote-3.38.0/src/synchronization/syncutils.hpp Examining data/gnote-3.38.0/src/synchronization/gnotesyncclient.hpp Examining data/gnote-3.38.0/src/synchronization/isyncmanager.cpp Examining data/gnote-3.38.0/src/synchronization/syncmanager.hpp Examining data/gnote-3.38.0/src/synchronization/filesystemsyncserver.hpp Examining data/gnote-3.38.0/src/synchronization/fusesyncserviceaddin.hpp Examining data/gnote-3.38.0/src/synchronization/syncserviceaddin.hpp Examining data/gnote-3.38.0/src/synchronization/fusesyncserviceaddin.cpp Examining data/gnote-3.38.0/src/synchronization/syncdialog.hpp Examining data/gnote-3.38.0/src/synchronization/syncui.hpp Examining data/gnote-3.38.0/src/synchronization/isyncmanager.hpp Examining data/gnote-3.38.0/src/synchronization/filesystemsyncserver.cpp Examining data/gnote-3.38.0/src/synchronization/syncmanager.cpp Examining data/gnote-3.38.0/src/synchronization/silentui.cpp Examining data/gnote-3.38.0/src/synchronization/syncdialog.cpp Examining data/gnote-3.38.0/src/synchronization/syncui.cpp Examining data/gnote-3.38.0/src/synchronization/syncserviceaddin.cpp Examining data/gnote-3.38.0/src/undo.hpp Examining data/gnote-3.38.0/src/itagmanager.cpp Examining data/gnote-3.38.0/src/debug.hpp Examining data/gnote-3.38.0/src/tagmanager.hpp Examining data/gnote-3.38.0/src/mainwindow.hpp Examining data/gnote-3.38.0/src/abstractaddin.hpp Examining data/gnote-3.38.0/src/searchnoteswidget.hpp Examining data/gnote-3.38.0/src/tag.hpp Examining data/gnote-3.38.0/src/utils.hpp Examining data/gnote-3.38.0/src/contrast.hpp Examining data/gnote-3.38.0/src/undo.cpp Examining data/gnote-3.38.0/src/tagmanager.cpp Examining data/gnote-3.38.0/src/abstractaddin.cpp Examining data/gnote-3.38.0/src/preferences.hpp Examining data/gnote-3.38.0/src/mainwindowaction.cpp Examining data/gnote-3.38.0/src/notebooks/notebooknoteaddin.hpp Examining data/gnote-3.38.0/src/notebooks/createnotebookdialog.cpp Examining data/gnote-3.38.0/src/notebooks/specialnotebooks.hpp Examining data/gnote-3.38.0/src/notebooks/notebookmanager.hpp Examining data/gnote-3.38.0/src/notebooks/notebook.cpp Examining data/gnote-3.38.0/src/notebooks/notebookmenuitem.cpp Examining data/gnote-3.38.0/src/notebooks/notebook.hpp Examining data/gnote-3.38.0/src/notebooks/notebookmenuitem.hpp Examining data/gnote-3.38.0/src/notebooks/notebooknewnotemenuitem.cpp Examining data/gnote-3.38.0/src/notebooks/createnotebookdialog.hpp Examining data/gnote-3.38.0/src/notebooks/notebookstreeview.cpp Examining data/gnote-3.38.0/src/notebooks/notebookapplicationaddin.cpp Examining data/gnote-3.38.0/src/notebooks/notebookstreeview.hpp Examining data/gnote-3.38.0/src/notebooks/notebooknewnotemenuitem.hpp Examining data/gnote-3.38.0/src/notebooks/notebookapplicationaddin.hpp Examining data/gnote-3.38.0/src/notebooks/notebookmanager.cpp Examining data/gnote-3.38.0/src/notebooks/notebooknoteaddin.cpp Examining data/gnote-3.38.0/src/notebooks/specialnotebooks.cpp Examining data/gnote-3.38.0/src/mainwindow.cpp Examining data/gnote-3.38.0/src/recentchanges.hpp Examining data/gnote-3.38.0/src/notetag.cpp Examining data/gnote-3.38.0/src/contrast.cpp Examining data/gnote-3.38.0/src/remotecontrolproxy.cpp Examining data/gnote-3.38.0/src/noterenamedialog.cpp Examining data/gnote-3.38.0/src/searchnoteswidget.cpp Examining data/gnote-3.38.0/src/preferences.cpp Examining data/gnote-3.38.0/src/addinmanager.cpp Examining data/gnote-3.38.0/src/gnote.cpp Examining data/gnote-3.38.0/src/note.hpp Examining data/gnote-3.38.0/src/iconmanager.hpp FINAL RESULTS: data/gnote-3.38.0/src/base/macros.hpp:40:29: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__ ((format (printf, f, a))); data/gnote-3.38.0/src/debug.cpp:170:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(file, fmt, marker); data/gnote-3.38.0/src/sharp/process.cpp:65:5: [4] (shell) execv: 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. execv(m_file_name.c_str(), argv); data/gnote-3.38.0/src/gnote.cpp:212:24: [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. const char * s = getenv("GNOTE_PATH"); data/gnote-3.38.0/src/mainwindow.cpp:123:42: [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. const char *current_desktop = std::getenv("XDG_CURRENT_DESKTOP"); data/gnote-3.38.0/src/synchronization/syncutils.cpp:203:37: [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. Glib::ustring pathVar = Glib::getenv("PATH"); data/gnote-3.38.0/src/watchers.cpp:594:27: [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. const char * home = getenv("HOME"); data/gnote-3.38.0/src/debug.cpp:121:18: [2] (misc) fopen: 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 *file = fopen(filename.c_str(), "a"); data/gnote-3.38.0/src/debug.cpp:160: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[128]; data/gnote-3.38.0/src/sharp/datetime.cpp:42:3: [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 output[256]; data/gnote-3.38.0/src/sharp/datetime.cpp:60:3: [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[36] = {0}; data/gnote-3.38.0/src/sharp/datetime.cpp:61:8: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. std::sprintf(buffer, "%d-%02d-%02dT%02d:%02d:%02.6lfZ", date.get_year(), date.get_month(), date.get_day_of_month(), date.get_hour(), date.get_minute(), date.get_seconds()); data/gnote-3.38.0/src/sharp/files.cpp:94:9: [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). fin.open(path.c_str()); data/gnote-3.38.0/src/sharp/files.cpp:132: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[buf_size]; data/gnote-3.38.0/src/sharp/process.cpp:196: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[255]; data/gnote-3.38.0/src/sharp/streamreader.cpp:52:12: [2] (misc) fopen: 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). m_file = fopen(filename.c_str(), "rb"); data/gnote-3.38.0/src/sharp/streamreader.cpp:62:3: [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[READ_BUFFER_COUNT + 1]; // +1 for the NUL terminate. data/gnote-3.38.0/src/sharp/streamwriter.cpp:51:12: [2] (misc) fopen: 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). m_file = fopen(filename.c_str(), "wb"); data/gnote-3.38.0/src/sharp/uuid.hpp:48: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 out[40]; data/gnote-3.38.0/src/synchronization/filesystemsyncserver.cpp:691:3: [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[buf_size]; data/gnote-3.38.0/src/test/unit/filesutests.cpp:82:14: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(temp_file_name); data/gnote-3.38.0/src/test/unit/filesutests.cpp:88:18: [2] (misc) fopen: 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 *file = fopen(temp_file_name, "w"); data/gnote-3.38.0/src/test/unit/filesutests.cpp:108:14: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(temp_file_name); data/gnote-3.38.0/src/test/unit/filesutests.cpp:114:18: [2] (misc) fopen: 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 *file = fopen(temp_file_name, "w"); data/gnote-3.38.0/src/test/unit/filesutests.cpp:129:14: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(temp_file_name); data/gnote-3.38.0/src/test/unit/filesutests.cpp:136:15: [2] (misc) fopen: 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 *f = fopen(temp_file_name, "w"); data/gnote-3.38.0/src/test/unit/filesutests.cpp:150:14: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(temp_file_name); data/gnote-3.38.0/src/test/unit/gnotesyncclientutests.cpp:54:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(temp_file_name); data/gnote-3.38.0/src/debug.cpp:162:20: [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). fwrite(buf, 1, strlen(buf), file); data/gnote-3.38.0/src/debug.cpp:163:23: [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). fwrite(prefix, 1, strlen(prefix), file); data/gnote-3.38.0/src/debug.cpp:166:23: [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). fwrite(func, 1, strlen(func), file); data/gnote-3.38.0/src/notebase.cpp:95:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(reader.read()) { data/gnote-3.38.0/src/notebase.cpp:350:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(xml.read()) { data/gnote-3.38.0/src/notebase.cpp:470:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void NoteArchiver::read(sharp::XmlReader & xml, NoteData & data) data/gnote-3.38.0/src/notebase.cpp:481:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(xml.read ()) { data/gnote-3.38.0/src/notebase.cpp:674:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(xml.read ()) { data/gnote-3.38.0/src/notebase.hpp:285:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(sharp::XmlReader & xml, NoteData & data); data/gnote-3.38.0/src/notebuffer.cpp:1400:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (xml.read ()) { data/gnote-3.38.0/src/notebuffer.cpp:1439:56: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). NoteTag::Ptr::cast_dynamic(tag_start.tag)->read (xml, true); data/gnote-3.38.0/src/notebuffer.cpp:1483:58: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). NoteTag::Ptr::cast_dynamic(tag_start.tag)->read (xml, false); data/gnote-3.38.0/src/notetag.cpp:153:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void NoteTag::read(sharp::XmlReader & xml, bool start) data/gnote-3.38.0/src/notetag.cpp:324:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void DynamicNoteTag::read(sharp::XmlReader & xml, bool start) data/gnote-3.38.0/src/notetag.cpp:327:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). NoteTag::read (xml, start); data/gnote-3.38.0/src/notetag.hpp:124:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual void read(sharp::XmlReader &, bool); data/gnote-3.38.0/src/notetag.hpp:201:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual void read(sharp::XmlReader &, bool) override; data/gnote-3.38.0/src/sharp/files.cpp:129:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto stream = path->read(); data/gnote-3.38.0/src/sharp/files.cpp:135:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read = stream->read(buffer, buf_size); data/gnote-3.38.0/src/sharp/files.cpp:136:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). os.write(buffer, read); data/gnote-3.38.0/src/sharp/process.cpp:197:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read_count = read(m_file, buf, sizeof(buf)); data/gnote-3.38.0/src/sharp/xmlreader.cpp:113:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool XmlReader::read() data/gnote-3.38.0/src/sharp/xmlreader.hpp:59:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(); data/gnote-3.38.0/src/synchronization/filesystemsyncserver.cpp:576:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(reader.read()) { data/gnote-3.38.0/src/synchronization/filesystemsyncserver.cpp:688:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto stream = xmlFile->read(); data/gnote-3.38.0/src/synchronization/filesystemsyncserver.cpp:694:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read = stream->read(buffer, buf_size); data/gnote-3.38.0/src/synchronization/filesystemsyncserver.cpp:695:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). os.write(buffer, read); data/gnote-3.38.0/src/synchronization/gnotesyncclient.cpp:119:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(reader.read()) { data/gnote-3.38.0/src/synchronization/gnotesyncclient.cpp:148:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(reader.read()) { data/gnote-3.38.0/src/synchronization/syncmanager.cpp:666:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(xml.read()) { data/gnote-3.38.0/src/synchronization/syncutils.cpp:53:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(xml.read()) { data/gnote-3.38.0/src/synchronization/syncutils.cpp:71:46: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). existing_note->manager().note_archiver().read(xml, *data); data/gnote-3.38.0/src/synchronization/syncutils.cpp:90:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(xml.read() && xml.get_name() == "note-content") { data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:52:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:73:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:101:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:122:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:136:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:139:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:142:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:145:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:147:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:150:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:153:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:155:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(xml.read()); data/gnote-3.38.0/src/test/unit/xmlreaderutests.cpp:157:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CHECK(!xml.read()); data/gnote-3.38.0/src/utils.cpp:580:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (xml.read ()) { ANALYSIS SUMMARY: Hits = 75 Lines analyzed = 47666 in approximately 1.45 seconds (32768 lines/second) Physical Source Lines of Code (SLOC) = 32088 Hits@level = [0] 5 [1] 47 [2] 21 [3] 4 [4] 3 [5] 0 Hits@level+ = [0+] 80 [1+] 75 [2+] 28 [3+] 7 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 2.49314 [1+] 2.33732 [2+] 0.8726 [3+] 0.21815 [4+] 0.0934929 [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.