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/unagi-0.3.4/rendering/render.c Examining data/unagi-0.3.4/plugins/expose.c Examining data/unagi-0.3.4/plugins/opacity.c Examining data/unagi-0.3.4/include/atoms.h Examining data/unagi-0.3.4/include/window.h Examining data/unagi-0.3.4/include/display.h Examining data/unagi-0.3.4/include/event.h Examining data/unagi-0.3.4/include/structs.h Examining data/unagi-0.3.4/include/plugin_common.h Examining data/unagi-0.3.4/include/plugin.h Examining data/unagi-0.3.4/include/rendering.h Examining data/unagi-0.3.4/include/system.h Examining data/unagi-0.3.4/include/key.h Examining data/unagi-0.3.4/include/util.h Examining data/unagi-0.3.4/src/key.c Examining data/unagi-0.3.4/src/display.c Examining data/unagi-0.3.4/src/rendering.c Examining data/unagi-0.3.4/src/util.c Examining data/unagi-0.3.4/src/atoms.c Examining data/unagi-0.3.4/src/event.c Examining data/unagi-0.3.4/src/unagi.c Examining data/unagi-0.3.4/src/plugin.c Examining data/unagi-0.3.4/src/plugin_common.c Examining data/unagi-0.3.4/src/window.c FINAL RESULTS: data/unagi-0.3.4/include/util.h:46:26: [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, 4, 5))); data/unagi-0.3.4/include/util.h:53:26: [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, 3, 4))); data/unagi-0.3.4/include/util.h:60:26: [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, 3, 4))); data/unagi-0.3.4/src/unagi.c:123:4: [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. printf(VERSION "\n"); data/unagi-0.3.4/src/util.c:36:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, LABEL ": %s:%d: ", func, line); \ data/unagi-0.3.4/src/util.c:37: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(stderr, fmt, ap); \ data/unagi-0.3.4/src/unagi.c:117:16: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((opt = getopt_long(argc, argv, "vhc:r:p:", data/unagi-0.3.4/src/plugin_common.c:44: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 path[path_len]; data/unagi-0.3.4/src/unagi.c:131:40: [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). if(!strlen(optarg) || !(config_fp = fopen(optarg, "r"))) data/unagi-0.3.4/src/unagi.c:157:23: [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). if((config_fp = fopen(XDG_CONFIG_DIR "/" CONFIG_FILENAME, "r")) == NULL) data/unagi-0.3.4/src/window.c:238:4: [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(&root_background_pixmap, data/unagi-0.3.4/src/plugin_common.c:41:27: [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). const size_t path_len = strlen(name) + strlen(dir) + sizeof(".so"); data/unagi-0.3.4/src/plugin_common.c:41:42: [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). const size_t path_len = strlen(name) + strlen(dir) + sizeof(".so"); data/unagi-0.3.4/src/unagi.c:131:8: [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). if(!strlen(optarg) || !(config_fp = fopen(optarg, "r"))) data/unagi-0.3.4/src/unagi.c:138:17: [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). if(optarg && strlen(optarg)) data/unagi-0.3.4/src/unagi.c:144:17: [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). if(optarg && strlen(optarg)) ANALYSIS SUMMARY: Hits = 16 Lines analyzed = 6614 in approximately 0.17 seconds (39438 lines/second) Physical Source Lines of Code (SLOC) = 3727 Hits@level = [0] 13 [1] 5 [2] 4 [3] 1 [4] 6 [5] 0 Hits@level+ = [0+] 29 [1+] 16 [2+] 11 [3+] 7 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 7.78106 [1+] 4.293 [2+] 2.95144 [3+] 1.87819 [4+] 1.60987 [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.