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/jester-1.0/jester.h Examining data/jester-1.0/jester.c FINAL RESULTS: data/jester-1.0/jester.c:239:5: [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(rv, s); data/jester-1.0/jester.c:895:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(text, format, white_pieces, black_pieces); data/jester-1.0/jester.c:1252:5: [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(copy, s); data/jester-1.0/jester.c:43:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/jester-1.0/jester.c:237:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. (s = getenv("DISPLAY"))) { data/jester-1.0/jester.c:269:8: [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). rv = atoi(s); data/jester-1.0/jester.c:888: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 text[256]; data/jester-1.0/jester.c:1261:10: [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). *x = atoi(p2); data/jester-1.0/jester.c:1267:10: [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). *y = atoi(p2); data/jester-1.0/jester.c:238:25: [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). rv = (char *)malloc(strlen(s) + 1); data/jester-1.0/jester.c:799:8: [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). strlen(exit_text)); data/jester-1.0/jester.c:864:31: [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). rv = XTextWidth(fstruct, s, strlen(s)); data/jester-1.0/jester.c:901:54: [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). XDrawString(display, score_window, gc, x, y, text, strlen(text)); data/jester-1.0/jester.c:950:58: [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). XDrawString(display, player_id_window, gc, x, y, text, strlen(text)); data/jester-1.0/jester.c:1251:27: [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). copy = (char *)malloc(strlen(s) + 1); ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 1437 in approximately 0.08 seconds (17651 lines/second) Physical Source Lines of Code (SLOC) = 1127 Hits@level = [0] 10 [1] 6 [2] 4 [3] 2 [4] 3 [5] 0 Hits@level+ = [0+] 25 [1+] 15 [2+] 9 [3+] 5 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 22.1828 [1+] 13.3097 [2+] 7.9858 [3+] 4.43656 [4+] 2.66193 [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.