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/stress-1.0.4/src/stress.c FINAL RESULTS: data/stress-1.0.4/src/stress.c:43:3: [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(OUT, STR, ##ARGS), fflush(OUT) data/stress-1.0.4/src/stress.c:47:3: [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(OUT, STR, ##ARGS), fflush(OUT) data/stress-1.0.4/src/stress.c:51:3: [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(OUT, STR, ##ARGS), fflush(OUT) data/stress-1.0.4/src/stress.c:55:3: [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(OUT, STR, ##ARGS), fflush(OUT) data/stress-1.0.4/src/stress.c:726:3: [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 (stdout, mesg, global_progname, VERSION); data/stress-1.0.4/src/stress.c:759:3: [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 (stdout, mesg, global_progname, global_progname, global_progname); data/stress-1.0.4/src/stress.c:543: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 buff[chunk]; data/stress-1.0.4/src/stress.c:561:17: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). if ((fd = mkstemp (name)) == -1) data/stress-1.0.4/src/stress.c:299:15: [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 (backoff); data/stress-1.0.4/src/stress.c:320:15: [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 (backoff); data/stress-1.0.4/src/stress.c:340:15: [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 (backoff); data/stress-1.0.4/src/stress.c:361:15: [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 (backoff); data/stress-1.0.4/src/stress.c:620:14: [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 ((pos = strlen (nptr) - 1) < 0) data/stress-1.0.4/src/stress.c:674:14: [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 ((pos = strlen (nptr) - 1) < 0) ANALYSIS SUMMARY: Hits = 14 Lines analyzed = 765 in approximately 0.03 seconds (23627 lines/second) Physical Source Lines of Code (SLOC) = 647 Hits@level = [0] 7 [1] 6 [2] 2 [3] 0 [4] 6 [5] 0 Hits@level+ = [0+] 21 [1+] 14 [2+] 8 [3+] 6 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 32.4575 [1+] 21.6383 [2+] 12.3648 [3+] 9.27357 [4+] 9.27357 [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.