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/deepin-movie-reborn-5.0.0/src/backends/mpv/mpv_glwidget.cpp Examining data/deepin-movie-reborn-5.0.0/src/backends/mpv/mpv_glwidget.h Examining data/deepin-movie-reborn-5.0.0/src/backends/mpv/mpv_proxy.cpp Examining data/deepin-movie-reborn-5.0.0/src/backends/mpv/mpv_proxy.h Examining data/deepin-movie-reborn-5.0.0/src/common/actions.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/actions.h Examining data/deepin-movie-reborn-5.0.0/src/common/dbus_adpator.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/dbus_adpator.h Examining data/deepin-movie-reborn-5.0.0/src/common/dmr_settings.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/dmr_settings.h Examining data/deepin-movie-reborn-5.0.0/src/common/event_monitor.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/event_monitor.h Examining data/deepin-movie-reborn-5.0.0/src/common/event_relayer.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/event_relayer.h Examining data/deepin-movie-reborn-5.0.0/src/common/mainwindow.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/mainwindow.h Examining data/deepin-movie-reborn-5.0.0/src/common/options.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/options.h Examining data/deepin-movie-reborn-5.0.0/src/common/settings_translation.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/shortcut_manager.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/shortcut_manager.h Examining data/deepin-movie-reborn-5.0.0/src/common/thumbnail_worker.cpp Examining data/deepin-movie-reborn-5.0.0/src/common/thumbnail_worker.h Examining data/deepin-movie-reborn-5.0.0/src/common/utility.h Examining data/deepin-movie-reborn-5.0.0/src/common/utility_x11.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.h Examining data/deepin-movie-reborn-5.0.0/src/libdmr/dvd_utils.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/dvd_utils.h Examining data/deepin-movie-reborn-5.0.0/src/libdmr/movie_configuration.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/movie_configuration.h Examining data/deepin-movie-reborn-5.0.0/src/libdmr/online_sub.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/online_sub.h Examining data/deepin-movie-reborn-5.0.0/src/libdmr/player_backend.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/player_backend.h Examining data/deepin-movie-reborn-5.0.0/src/libdmr/player_engine.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/player_engine.h Examining data/deepin-movie-reborn-5.0.0/src/libdmr/player_widget.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/player_widget.h Examining data/deepin-movie-reborn-5.0.0/src/libdmr/playlist_model.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/playlist_model.h Examining data/deepin-movie-reborn-5.0.0/src/libdmr/utils.cpp Examining data/deepin-movie-reborn-5.0.0/src/libdmr/utils.h Examining data/deepin-movie-reborn-5.0.0/src/main.cpp Examining data/deepin-movie-reborn-5.0.0/src/test/dmr_test.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/burst_screenshots_dialog.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/burst_screenshots_dialog.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/dmr_lineedit.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/dmr_lineedit.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/movie_progress_indicator.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/movie_progress_indicator.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/movieinfo_dialog.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/movieinfo_dialog.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/notification_widget.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/notification_widget.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/playlist_widget.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/playlist_widget.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/slider.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/slider.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/tip.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/tip.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/titlebar.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/titlebar.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/toolbox_proxy.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/toolbox_proxy.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/toolbutton.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/toolbutton.h Examining data/deepin-movie-reborn-5.0.0/src/widgets/url_dialog.cpp Examining data/deepin-movie-reborn-5.0.0/src/widgets/url_dialog.h FINAL RESULTS: data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:267:9: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. if (readlink(buf, buf2, sizeof buf2) < 0) { data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:283:9: [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 (access(path, F_OK) != 0) { data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:290:9: [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 (access(buf, R_OK) == 0) { data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:225: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 (!f.open(QFile::ReadOnly)) { data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:263: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[1024] = {0}; data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:266: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 buf2[1024] = {0}; data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:281: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 path[128]; data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:288: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[512]; data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:291:20: [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* fp = fopen(buf, "r"); data/deepin-movie-reborn-5.0.0/src/libdmr/compositing_manager.cpp:357: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). f.open(QIODevice::ReadOnly); data/deepin-movie-reborn-5.0.0/src/libdmr/movie_configuration.cpp:70: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). _db.open(); data/deepin-movie-reborn-5.0.0/src/libdmr/online_sub.cpp:63: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 (!f.open(QFile::ReadOnly)) { data/deepin-movie-reborn-5.0.0/src/libdmr/online_sub.cpp:75:18: [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 out[16]; data/deepin-movie-reborn-5.0.0/src/libdmr/online_sub.cpp:82: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 md5[32]; data/deepin-movie-reborn-5.0.0/src/libdmr/online_sub.cpp:246: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 (f.open(QFile::WriteOnly)) { data/deepin-movie-reborn-5.0.0/src/libdmr/playlist_model.cpp:182: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 (f.open(QIODevice::ReadOnly)) { data/deepin-movie-reborn-5.0.0/src/libdmr/playlist_model.cpp:196: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 (f.open(QIODevice::ReadOnly)) { data/deepin-movie-reborn-5.0.0/src/libdmr/playlist_model.cpp:218: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 (f.open(QIODevice::WriteOnly)) { data/deepin-movie-reborn-5.0.0/src/libdmr/playlist_model.cpp:231: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 (f.open(QIODevice::WriteOnly)) { data/deepin-movie-reborn-5.0.0/src/libdmr/utils.cpp:181: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 (!f.open(QFile::ReadOnly)) { data/deepin-movie-reborn-5.0.0/src/libdmr/utils.cpp:206: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 (!f.open(QFile::ReadOnly)) { data/deepin-movie-reborn-5.0.0/src/common/utility_x11.cpp:68:85: [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). xcb_intern_atom_cookie_t cookie = xcb_intern_atom(QX11Info::connection(), true, strlen(name), name); data/deepin-movie-reborn-5.0.0/src/libdmr/online_sub.cpp:69:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto bytes = f.read(4096); data/deepin-movie-reborn-5.0.0/src/libdmr/utils.cpp:193:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes += f.read(4096); data/deepin-movie-reborn-5.0.0/src/libdmr/utils.cpp:381:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto img = reader.read(); ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 16908 in approximately 0.47 seconds (36342 lines/second) Physical Source Lines of Code (SLOC) = 11878 Hits@level = [0] 13 [1] 4 [2] 18 [3] 0 [4] 2 [5] 1 Hits@level+ = [0+] 38 [1+] 25 [2+] 21 [3+] 3 [4+] 3 [5+] 1 Hits/KSLOC@level+ = [0+] 3.19919 [1+] 2.10473 [2+] 1.76797 [3+] 0.252568 [4+] 0.252568 [5+] 0.0841893 Dot directories skipped = 2 (--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.