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/kchmviewer-7.7/lib/libebook/helperxmlhandler_epubtoc.cpp Examining data/kchmviewer-7.7/lib/libebook/ebook_search.h Examining data/kchmviewer-7.7/lib/libebook/bitfiddle.h Examining data/kchmviewer-7.7/lib/libebook/ebook_chm_encoding.h Examining data/kchmviewer-7.7/lib/libebook/ebook.cpp Examining data/kchmviewer-7.7/lib/libebook/ebook_url.h Examining data/kchmviewer-7.7/lib/libebook/ebook_search.cpp Examining data/kchmviewer-7.7/lib/libebook/ebook_epub.cpp Examining data/kchmviewer-7.7/lib/libebook/helper_search_index.cpp Examining data/kchmviewer-7.7/lib/libebook/helperxmlhandler_epubcontent.cpp Examining data/kchmviewer-7.7/lib/libebook/helper_search_index.h Examining data/kchmviewer-7.7/lib/libebook/ebook.h Examining data/kchmviewer-7.7/lib/libebook/helper_entitydecoder.h Examining data/kchmviewer-7.7/lib/libebook/helperxmlhandler_epubcontainer.cpp Examining data/kchmviewer-7.7/lib/libebook/helperxmlhandler_epubcontent.h Examining data/kchmviewer-7.7/lib/libebook/helperxmlhandler_epubcontainer.h Examining data/kchmviewer-7.7/lib/libebook/helperxmlhandler_epubtoc.h Examining data/kchmviewer-7.7/lib/libebook/helper_entitydecoder.cpp Examining data/kchmviewer-7.7/lib/libebook/ebook_chm.h Examining data/kchmviewer-7.7/lib/libebook/ebook_epub.h Examining data/kchmviewer-7.7/lib/libebook/ebook_chm_encoding.cpp Examining data/kchmviewer-7.7/lib/libebook/ebook_chm.cpp Examining data/kchmviewer-7.7/src/viewwindow_webkit.cpp Examining data/kchmviewer-7.7/src/treeitem_toc.h Examining data/kchmviewer-7.7/src/settings.h Examining data/kchmviewer-7.7/src/dataprovider_qwebengine.h Examining data/kchmviewer-7.7/src/tab_bookmarks.h Examining data/kchmviewer-7.7/src/checknewversion.cpp Examining data/kchmviewer-7.7/src/dataprovider_qwebkit.cpp Examining data/kchmviewer-7.7/src/treeitem_index.h Examining data/kchmviewer-7.7/src/mainwindow.cpp Examining data/kchmviewer-7.7/src/treeitem_toc.cpp Examining data/kchmviewer-7.7/src/main.cpp Examining data/kchmviewer-7.7/src/dataprovider_qwebengine.cpp Examining data/kchmviewer-7.7/src/tab_search.cpp Examining data/kchmviewer-7.7/src/dialog_setup.h Examining data/kchmviewer-7.7/src/dbus_interface.h Examining data/kchmviewer-7.7/src/kde-qt.h Examining data/kchmviewer-7.7/src/recentfiles.cpp Examining data/kchmviewer-7.7/src/treeitem_index.cpp Examining data/kchmviewer-7.7/src/toolbarmanager.h Examining data/kchmviewer-7.7/src/kchmviewerapp.h Examining data/kchmviewer-7.7/src/tab_bookmarks.cpp Examining data/kchmviewer-7.7/src/textencodings.h Examining data/kchmviewer-7.7/src/version.h Examining data/kchmviewer-7.7/src/kde-qt.cpp Examining data/kchmviewer-7.7/src/navigationpanel.h Examining data/kchmviewer-7.7/src/tab_contents.h Examining data/kchmviewer-7.7/src/viewwindow.h Examining data/kchmviewer-7.7/src/tab_index.cpp Examining data/kchmviewer-7.7/src/dataprovider_qwebkit.h Examining data/kchmviewer-7.7/src/viewwindow_webengine.h Examining data/kchmviewer-7.7/src/recentfiles.h Examining data/kchmviewer-7.7/src/viewwindowmgr.cpp Examining data/kchmviewer-7.7/src/textencodings.cpp Examining data/kchmviewer-7.7/src/viewwindow_webengine.cpp Examining data/kchmviewer-7.7/src/viewwindowmgr.h Examining data/kchmviewer-7.7/src/checknewversion.h Examining data/kchmviewer-7.7/src/tab_search.h Examining data/kchmviewer-7.7/src/viewwindow_webkit.h Examining data/kchmviewer-7.7/src/settings.cpp Examining data/kchmviewer-7.7/src/config.h Examining data/kchmviewer-7.7/src/tab_index.h Examining data/kchmviewer-7.7/src/toolbareditor.h Examining data/kchmviewer-7.7/src/dialog_chooseurlfromlist.h Examining data/kchmviewer-7.7/src/toolbarmanager.cpp Examining data/kchmviewer-7.7/src/mainwindow.h Examining data/kchmviewer-7.7/src/navigationpanel.cpp Examining data/kchmviewer-7.7/src/toolbareditor.cpp Examining data/kchmviewer-7.7/src/kchmviewerapp.cpp Examining data/kchmviewer-7.7/src/tab_contents.cpp Examining data/kchmviewer-7.7/src/dbus_interface.cpp Examining data/kchmviewer-7.7/src/dialog_chooseurlfromlist.cpp Examining data/kchmviewer-7.7/src/config.cpp Examining data/kchmviewer-7.7/src/dialog_setup.cpp FINAL RESULTS: data/kchmviewer-7.7/lib/libebook/ebook_chm.cpp:45:17: [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. m_envOptions = getenv("KCHMVIEWEROPTS"); data/kchmviewer-7.7/lib/libebook/ebook_chm.cpp:604: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. unsigned char buffer[BUF_SIZE]; data/kchmviewer-7.7/lib/libebook/ebook_chm.cpp:678: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. unsigned char buffer[BUF_SIZE]; data/kchmviewer-7.7/lib/libebook/ebook_epub.cpp:53: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). if ( !m_epubFile.open( QIODevice::ReadOnly ) ) data/kchmviewer-7.7/src/checknewversion.cpp:158: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 buf[2048]; data/kchmviewer-7.7/src/checknewversion.cpp:172: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 (&saddr.sin_addr, hp->h_addr, (size_t) hp->h_length); data/kchmviewer-7.7/src/dataprovider_qwebkit.cpp:59: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(buffer, m_data.constData(), len); data/kchmviewer-7.7/src/mainwindow.cpp:170:17: [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( data + 2, args.data(), args.size() ); data/kchmviewer-7.7/src/mainwindow.cpp:968:13: [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 ( !wf.open( QIODevice::WriteOnly ) ) data/kchmviewer-7.7/src/mainwindow.cpp:1014:13: [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 ( !tf->open() ) data/kchmviewer-7.7/src/settings.cpp:146: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 ( !file.open (QIODevice::ReadOnly) ) data/kchmviewer-7.7/src/settings.cpp:243: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 ( !file.open (QIODevice::WriteOnly) ) data/kchmviewer-7.7/src/tab_search.cpp:212:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ( file.open( QIODevice::ReadOnly ) ) data/kchmviewer-7.7/src/tab_search.cpp:244:13: [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 ) ) data/kchmviewer-7.7/src/checknewversion.cpp:203:36: [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). unsigned int offset = 0, length = strlen( reqmsg ); ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 12891 in approximately 0.32 seconds (40454 lines/second) Physical Source Lines of Code (SLOC) = 7976 Hits@level = [0] 6 [1] 1 [2] 13 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 21 [1+] 15 [2+] 14 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 2.6329 [1+] 1.88064 [2+] 1.75527 [3+] 0.125376 [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.