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/yacpi-3.0.1/yacpi.h Examining data/yacpi-3.0.1/get_cpu.c Examining data/yacpi-3.0.1/get_cpu.h Examining data/yacpi-3.0.1/yacpi.c FINAL RESULTS: data/yacpi-3.0.1/yacpi.c:492:19: [3] (buffer) getopt: 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 ((option = getopt(argc, argv, "fnpahvtblcgd:")) != -1) { data/yacpi-3.0.1/get_cpu.c:26:14: [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((cpuinfo=fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq","r"))==NULL){ data/yacpi-3.0.1/get_cpu.c:38:14: [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((cpuinfo=fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq","r"))==NULL){ data/yacpi-3.0.1/get_cpu.c:49: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[128]; data/yacpi-3.0.1/get_cpu.c:50:14: [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((cpuinfo=fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor","r"))==NULL){ data/yacpi-3.0.1/get_cpu.c:54: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). buffer[strlen(buffer) - 1]='\0'; data/yacpi-3.0.1/yacpi.c:130:29: [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). mvprintw(LINES - 1, COLS - strlen(helptext), "%s", helptext); ANALYSIS SUMMARY: Hits = 7 Lines analyzed = 706 in approximately 0.03 seconds (26025 lines/second) Physical Source Lines of Code (SLOC) = 574 Hits@level = [0] 30 [1] 2 [2] 4 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 37 [1+] 7 [2+] 5 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 64.4599 [1+] 12.1951 [2+] 8.7108 [3+] 1.74216 [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.