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/pipebench-0.40/pipebench.c FINAL RESULTS: data/pipebench-0.40/pipebench.c:274:3: [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(ctimebuf,ctime(&tv2.tv_sec)); data/pipebench-0.40/pipebench.c:172:21: [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 (EOF != (c = getopt(argc, argv, "ehqQb:ros:S:Iu"))) { data/pipebench-0.40/pipebench.c:155: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 tdbuf[64]; data/pipebench-0.40/pipebench.c:156: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 speedbuf[64]; data/pipebench-0.40/pipebench.c:157: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 datalenbuf[64]; data/pipebench-0.40/pipebench.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). bufsize = atoi(optarg); data/pipebench-0.40/pipebench.c:218:19: [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 (!(statusf = fopen(statusfn, statusf_append?"a":"w"))) { data/pipebench-0.40/pipebench.c:248: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 ctimebuf[64]; data/pipebench-0.40/pipebench.c:275:10: [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 ((n=strlen(ctimebuf)) && ctimebuf[n-1] == '\n') { ANALYSIS SUMMARY: Hits = 9 Lines analyzed = 328 in approximately 0.02 seconds (13655 lines/second) Physical Source Lines of Code (SLOC) = 251 Hits@level = [0] 8 [1] 1 [2] 6 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 17 [1+] 9 [2+] 8 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 67.7291 [1+] 35.8566 [2+] 31.8725 [3+] 7.96813 [4+] 3.98406 [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.