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/nitrogen-1.6.1/src/NWindow.h Examining data/nitrogen-1.6.1/src/NWindow.cc Examining data/nitrogen-1.6.1/src/Util.cc Examining data/nitrogen-1.6.1/src/ImageCombo.h Examining data/nitrogen-1.6.1/src/Inotify.h Examining data/nitrogen-1.6.1/src/NPrefsWindow.cc Examining data/nitrogen-1.6.1/src/main.h Examining data/nitrogen-1.6.1/src/Config.cc Examining data/nitrogen-1.6.1/src/md5.c Examining data/nitrogen-1.6.1/src/Thumbview.cc Examining data/nitrogen-1.6.1/src/gcs-i18n.h Examining data/nitrogen-1.6.1/src/SetBG.h Examining data/nitrogen-1.6.1/src/ArgParser.cc Examining data/nitrogen-1.6.1/src/ImageCombo.cc Examining data/nitrogen-1.6.1/src/Util.h Examining data/nitrogen-1.6.1/src/Thumbview.h Examining data/nitrogen-1.6.1/src/main.cc Examining data/nitrogen-1.6.1/src/ArgParser.h Examining data/nitrogen-1.6.1/src/Config.h Examining data/nitrogen-1.6.1/src/NPrefsWindow.h Examining data/nitrogen-1.6.1/src/md5.h Examining data/nitrogen-1.6.1/src/SetBG.cc Examining data/nitrogen-1.6.1/src/Inotify.cc FINAL RESULTS: data/nitrogen-1.6.1/src/Thumbview.cc:355:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(full, buf); data/nitrogen-1.6.1/src/Util.cc:54:2: [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. access (str, F_OK); data/nitrogen-1.6.1/src/main.cc:41:131: [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 set_bg_once(Config *cfg, SetBG* bg_setter, Glib::ustring path, int head, SetBG::SetMode mode, bool save, Gdk::Color col, bool random) data/nitrogen-1.6.1/src/main.cc:47:9: [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. if (random) { data/nitrogen-1.6.1/src/main.cc:239:104: [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. return set_bg_once(cfg, setter, startdir, xin_head, mode, parser->has_argument("save"), color, random); data/nitrogen-1.6.1/src/Inotify.cc:69:2: [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[MAXLEN]; data/nitrogen-1.6.1/src/SetBG.cc:663:57: [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). Glib::RefPtr<Gdk::Display> _display = Gdk::Display::open(Gdk::DisplayManager::get()->get_default_display()->get_name()); data/nitrogen-1.6.1/src/SetBG.cc:1038:34: [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). _display = Gdk::Display::open(disp); data/nitrogen-1.6.1/src/Thumbview.cc:354:3: [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. sprintf(buf, "%02x", digest[di]); data/nitrogen-1.6.1/src/Thumbview.cc:487:3: [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. sprintf(bufout, "%ld", mtime); data/nitrogen-1.6.1/src/md5.c:53: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. static const char *const test[7] = { data/nitrogen-1.6.1/src/md5.c:204:2: [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(xbuf, data, 64); data/nitrogen-1.6.1/src/md5.c:355:2: [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(pms->buf + offset, p, copy); data/nitrogen-1.6.1/src/md5.c:369:2: [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(pms->buf, p, left); data/nitrogen-1.6.1/src/Inotify.cc:71:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size = read(inotify_fd, buffer, MAXLEN); data/nitrogen-1.6.1/src/Thumbview.cc:346:58: [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). md5_append(&state, (const md5_byte_t *)urifile.c_str(), strlen(urifile.c_str())); data/nitrogen-1.6.1/src/md5.c:71:50: [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). md5_append(&state, (const md5_byte_t *)test[i], strlen(test[i])); ANALYSIS SUMMARY: Hits = 17 Lines analyzed = 6073 in approximately 0.33 seconds (18356 lines/second) Physical Source Lines of Code (SLOC) = 3594 Hits@level = [0] 5 [1] 3 [2] 9 [3] 3 [4] 2 [5] 0 Hits@level+ = [0+] 22 [1+] 17 [2+] 14 [3+] 5 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 6.12131 [1+] 4.73011 [2+] 3.89538 [3+] 1.39121 [4+] 0.556483 [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.