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/idle3-tools-0.9.1/sgio.c Examining data/idle3-tools-0.9.1/sgio.h Examining data/idle3-tools-0.9.1/idle3ctl.c FINAL RESULTS: data/idle3-tools-0.9.1/idle3ctl.c:139: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 buffer[512]; data/idle3-tools-0.9.1/idle3ctl.c:189: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 buffer[512]; data/idle3-tools-0.9.1/idle3ctl.c:220: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 buffer[512]; data/idle3-tools-0.9.1/idle3ctl.c:313:36: [2] (integer) atoi: 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). if (strlen(argv[i])>2) timer=atoi(argv[i]+2); data/idle3-tools-0.9.1/idle3ctl.c:315:29: [2] (integer) atoi: 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). if (++i<argc) timer=atoi(argv[i]); data/idle3-tools-0.9.1/idle3ctl.c:332:12: [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). fd = open(device, O_RDONLY|O_NONBLOCK); data/idle3-tools-0.9.1/sgio.c:161:11: [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. unsigned char cdb[SG_ATA_16_LEN]; data/idle3-tools-0.9.1/sgio.c:162:11: [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. unsigned char sb[32], *desc; data/idle3-tools-0.9.1/idle3ctl.c:313:11: [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(argv[i])>2) timer=atoi(argv[i]+2); ANALYSIS SUMMARY: Hits = 9 Lines analyzed = 1136 in approximately 0.05 seconds (21870 lines/second) Physical Source Lines of Code (SLOC) = 925 Hits@level = [0] 77 [1] 1 [2] 8 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 86 [1+] 9 [2+] 8 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 92.973 [1+] 9.72973 [2+] 8.64865 [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.