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/wmcpu-1.4/wmcpu.c FINAL RESULTS: data/wmcpu-1.4/wmcpu.c:70:15: [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 ((ch = getopt(argc, argv, "d:hvlt:")) != EOF) { data/wmcpu-1.4/wmcpu.c:85:15: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). udelay = atol(optarg); data/wmcpu-1.4/wmcpu.c:111: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 str[128]; data/wmcpu-1.4/wmcpu.c:129:11: [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((fp = fopen("/proc/meminfo", "r")) != NULL) { data/wmcpu-1.4/wmcpu.c:176: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). if ((fp = fopen("/proc/stat", "r")) != NULL) { data/wmcpu-1.4/wmcpu.c:210: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). if ((fp = fopen("/proc/loadavg", "r")) != NULL) { data/wmcpu-1.4/wmcpu.c:253:27: [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 (has_meminfo && (fp = fopen("/proc/meminfo", "r")) != NULL) { data/wmcpu-1.4/wmcpu.c:294: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). if ((fp = fopen("/proc/uptime", "r")) != NULL) { data/wmcpu-1.4/wmcpu.c:140:9: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. while(fscanf(fp," %127s%*[^\n]",str) > 0) { data/wmcpu-1.4/wmcpu.c:178:3: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. fscanf(fp, "%127s%f%f%f%f", str, info, info + 1, info + 2, info + 3); data/wmcpu-1.4/wmcpu.c:337:2: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(udelay); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 427 in approximately 0.03 seconds (14158 lines/second) Physical Source Lines of Code (SLOC) = 323 Hits@level = [0] 5 [1] 3 [2] 7 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 16 [1+] 11 [2+] 8 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 49.5356 [1+] 34.0557 [2+] 24.7678 [3+] 3.09598 [4+] 0 [5+] 0 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.