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/mousetweaks-3.32.0/src/mt-ctw.h Examining data/mousetweaks-3.32.0/src/mt-timer.c Examining data/mousetweaks-3.32.0/src/mt-enum-types.h Examining data/mousetweaks-3.32.0/src/mt-timer.h Examining data/mousetweaks-3.32.0/src/mt-pidfile.h Examining data/mousetweaks-3.32.0/src/mt-enum-types.c Examining data/mousetweaks-3.32.0/src/mt-common.c Examining data/mousetweaks-3.32.0/src/mt-cursor-manager.c Examining data/mousetweaks-3.32.0/src/mt-sig-handler.c Examining data/mousetweaks-3.32.0/src/mt-sig-handler.h Examining data/mousetweaks-3.32.0/src/mt-cursor.c Examining data/mousetweaks-3.32.0/src/mt-cursor.h Examining data/mousetweaks-3.32.0/src/mt-common.h Examining data/mousetweaks-3.32.0/src/mt-listener.h Examining data/mousetweaks-3.32.0/src/mt-settings.h Examining data/mousetweaks-3.32.0/src/mt-cursor-manager.h Examining data/mousetweaks-3.32.0/src/mt-main.c Examining data/mousetweaks-3.32.0/src/mt-service.h Examining data/mousetweaks-3.32.0/src/mt-ctw.c Examining data/mousetweaks-3.32.0/src/mt-pidfile.c Examining data/mousetweaks-3.32.0/src/mt-service.c Examining data/mousetweaks-3.32.0/src/mt-settings.c Examining data/mousetweaks-3.32.0/src/mt-listener.c FINAL RESULTS: data/mousetweaks-3.32.0/src/mt-pidfile.c:50:12: [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 char fn[512]; data/mousetweaks-3.32.0/src/mt-pidfile.c:86:12: [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 char txt[256]; data/mousetweaks-3.32.0/src/mt-pidfile.c:99: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 ((fd = open (fn, O_RDWR, 0644)) < 0) data/mousetweaks-3.32.0/src/mt-pidfile.c:192: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 t[64]; data/mousetweaks-3.32.0/src/mt-pidfile.c:204: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 ((fd = open (fn, O_CREAT|O_RDWR|O_EXCL, 0644)) < 0) data/mousetweaks-3.32.0/src/mt-pidfile.c:105:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((l = read (fd, txt, sizeof(txt) - 1)) < 0) data/mousetweaks-3.32.0/src/mt-pidfile.c:196:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). u = umask(022); data/mousetweaks-3.32.0/src/mt-pidfile.c:216:9: [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). l = strlen (t); data/mousetweaks-3.32.0/src/mt-pidfile.c:240:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(u); ANALYSIS SUMMARY: Hits = 9 Lines analyzed = 4219 in approximately 0.10 seconds (43448 lines/second) Physical Source Lines of Code (SLOC) = 3091 Hits@level = [0] 2 [1] 4 [2] 5 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 11 [1+] 9 [2+] 5 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 3.55872 [1+] 2.91168 [2+] 1.6176 [3+] 0 [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.