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/kanshi-1.1.0/include/config.h Examining data/kanshi-1.1.0/include/kanshi.h Examining data/kanshi-1.1.0/include/parser.h Examining data/kanshi-1.1.0/main.c Examining data/kanshi-1.1.0/parser.c FINAL RESULTS: data/kanshi-1.1.0/main.c:86:4: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/bin/sh", "/bin/sh", "-c", cmd, (void *)NULL); data/kanshi-1.1.0/main.c:466:32: [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. const char *xdg_config_home = getenv("XDG_CONFIG_HOME"); data/kanshi-1.1.0/main.c:467:21: [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. const char *home = getenv("HOME"); data/kanshi-1.1.0/include/parser.h:21: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 tok_str[1024]; data/kanshi-1.1.0/main.c:465: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 config_path[PATH_MAX]; data/kanshi-1.1.0/parser.c:424: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 generated_name[100]; data/kanshi-1.1.0/parser.c:527:12: [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 *f = fopen(path, "r"); data/kanshi-1.1.0/parser.c:36:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int ch = fgetc(parser->f); ANALYSIS SUMMARY: Hits = 8 Lines analyzed = 1198 in approximately 0.39 seconds (3084 lines/second) Physical Source Lines of Code (SLOC) = 1020 Hits@level = [0] 42 [1] 1 [2] 4 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 50 [1+] 8 [2+] 7 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 49.0196 [1+] 7.84314 [2+] 6.86275 [3+] 2.94118 [4+] 0.980392 [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.