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/ttyload-0.5+20131024+gitf949537/arch/FreeBSD/getload.c Examining data/ttyload-0.5+20131024+gitf949537/arch/FreeBSD/terminfo.c Examining data/ttyload-0.5+20131024+gitf949537/arch/IRIX/getload.c Examining data/ttyload-0.5+20131024+gitf949537/arch/IRIX/terminfo.c Examining data/ttyload-0.5+20131024+gitf949537/arch/Linux/getload.c Examining data/ttyload-0.5+20131024+gitf949537/arch/Linux/terminfo.c Examining data/ttyload-0.5+20131024+gitf949537/arch/SunOS/getload.c Examining data/ttyload-0.5+20131024+gitf949537/arch/SunOS/terminfo.c Examining data/ttyload-0.5+20131024+gitf949537/arch/GNU/getload.c Examining data/ttyload-0.5+20131024+gitf949537/arch/GNU/terminfo.c Examining data/ttyload-0.5+20131024+gitf949537/archtest.c Examining data/ttyload-0.5+20131024+gitf949537/loader.c Examining data/ttyload-0.5+20131024+gitf949537/ttyload.c Examining data/ttyload-0.5+20131024+gitf949537/ttyload.h FINAL RESULTS: data/ttyload-0.5+20131024+gitf949537/ttyload.c:132:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(theclocks[theclock].clock, strbuf); data/ttyload-0.5+20131024+gitf949537/ttyload.c:207:2: [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, usage, basename); data/ttyload-0.5+20131024+gitf949537/ttyload.c:169:16: [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((c = getopt(argc, argv, optstring)) != EOF) data/ttyload-0.5+20131024+gitf949537/arch/GNU/getload.c:26:21: [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(!(loadfile = fopen(LOADFILE, "r"))) data/ttyload-0.5+20131024+gitf949537/arch/Linux/getload.c:26:21: [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(!(loadfile = fopen(LOADFILE, "r"))) data/ttyload-0.5+20131024+gitf949537/ttyload.c:37:1: [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 strbuf[BUFSIZ], data/ttyload-0.5+20131024+gitf949537/ttyload.c:93:1: [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 hostname[HOSTLENGTH + 1]; data/ttyload-0.5+20131024+gitf949537/ttyload.c:175:13: [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). intsecs = atoi(optarg); data/ttyload-0.5+20131024+gitf949537/ttyload.c:185:14: [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). rows = atoi(optarg); data/ttyload-0.5+20131024+gitf949537/ttyload.c:188:14: [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). cols = atoi(optarg); data/ttyload-0.5+20131024+gitf949537/ttyload.c:215:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(hostname, "localhost"); data/ttyload-0.5+20131024+gitf949537/ttyload.h:37: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 clock[7]; data/ttyload-0.5+20131024+gitf949537/ttyload.c:463:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( ANALYSIS SUMMARY: Hits = 13 Lines analyzed = 1102 in approximately 0.04 seconds (27748 lines/second) Physical Source Lines of Code (SLOC) = 765 Hits@level = [0] 44 [1] 1 [2] 9 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 57 [1+] 13 [2+] 12 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 74.5098 [1+] 16.9935 [2+] 15.6863 [3+] 3.92157 [4+] 2.61438 [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.