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/late-0.1.0/src/arch.cpp Examining data/late-0.1.0/src/square.h Examining data/late-0.1.0/src/sidebar.cpp Examining data/late-0.1.0/src/square.cpp Examining data/late-0.1.0/src/ball.cpp Examining data/late-0.1.0/src/game.h Examining data/late-0.1.0/src/graphics.h Examining data/late-0.1.0/src/graphics.cpp Examining data/late-0.1.0/src/boringball.h Examining data/late-0.1.0/src/point.h Examining data/late-0.1.0/src/text.h Examining data/late-0.1.0/src/slicer.cpp Examining data/late-0.1.0/src/slicer.h Examining data/late-0.1.0/src/text.cpp Examining data/late-0.1.0/src/arch.h Examining data/late-0.1.0/src/boringball.cpp Examining data/late-0.1.0/src/killerball.h Examining data/late-0.1.0/src/killerball.cpp Examining data/late-0.1.0/src/sidebar.h Examining data/late-0.1.0/src/player.cpp Examining data/late-0.1.0/src/player.h Examining data/late-0.1.0/src/stripmaker.c Examining data/late-0.1.0/src/splitball.h Examining data/late-0.1.0/src/menu.h Examining data/late-0.1.0/src/goody.h Examining data/late-0.1.0/src/goody.cpp Examining data/late-0.1.0/src/scorescreen.h Examining data/late-0.1.0/src/highscores.h Examining data/late-0.1.0/src/explosiveball.h Examining data/late-0.1.0/src/explosiveball.cpp Examining data/late-0.1.0/src/splitball.cpp Examining data/late-0.1.0/src/chronoball.h Examining data/late-0.1.0/src/chronoball.cpp Examining data/late-0.1.0/src/highscores.cpp Examining data/late-0.1.0/src/magnet.h Examining data/late-0.1.0/src/magnet.cpp Examining data/late-0.1.0/src/init.cpp Examining data/late-0.1.0/src/ball.h Examining data/late-0.1.0/src/game.cpp Examining data/late-0.1.0/src/menu.cpp Examining data/late-0.1.0/src/scorescreen.cpp Examining data/late-0.1.0/acconfig.h Examining data/late-0.1.0/config.h FINAL RESULTS: data/late-0.1.0/src/arch.cpp:48:16: [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). output = strcpy(output, filename); data/late-0.1.0/src/arch.cpp:56:16: [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). output = strcpy(output, n); data/late-0.1.0/src/arch.cpp:60:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(n, 200, DATADIR"/%s", filename); data/late-0.1.0/src/arch.cpp:63:16: [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). output = strcpy(output, n); data/late-0.1.0/src/arch.cpp:73:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(n, 200, LOCALSTATEDIR"/lib/games/late.scores"); data/late-0.1.0/src/arch.cpp:74:12: [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). output = strcpy(output, n); data/late-0.1.0/src/arch.cpp:83:12: [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). output = strcpy(output, n); data/late-0.1.0/src/arch.cpp:89:17: [4] (misc) cuserid: Exactly what cuserid() does is poorly defined (e.g., some systems use the effective uid, like Linux, while others like System V use the real uid). Thus, you can't trust what it does. It's certainly not portable (The cuserid function was included in the 1988 version of POSIX, but removed from the 1990 version). Also, if passed a non-null parameter, there's a risk of a buffer overflow if the passed-in buffer is not at least L_cuserid characters long (CWE-120). Use getpwuid(geteuid()) and extract the desired information instead. return string(cuserid(temp)); data/late-0.1.0/src/arch.cpp:82:34: [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. snprintf(n, 200, "%s/.laterc", getenv("HOME")); data/late-0.1.0/src/game.cpp:783: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(0)); data/late-0.1.0/src/arch.cpp:52: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 n[200]; data/late-0.1.0/src/arch.cpp:72: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 n[200]; data/late-0.1.0/src/arch.cpp:81: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 n[200]; data/late-0.1.0/src/arch.cpp:88: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 temp[200]; data/late-0.1.0/src/game.cpp:141: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 temp[100]; data/late-0.1.0/src/game.cpp:170:21: [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). clearnessneeded = atoi(temp); data/late-0.1.0/src/game.cpp:171: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 bgfile[20]; data/late-0.1.0/src/graphics.cpp:85: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 absfile[200]; data/late-0.1.0/src/graphics.cpp:86: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 absfilea[200]; data/late-0.1.0/src/graphics.cpp:131: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 curname[200]; data/late-0.1.0/src/highscores.cpp:13: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 output[50]; data/late-0.1.0/src/highscores.cpp:34: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 output[50]; data/late-0.1.0/src/init.cpp:41: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 n[200]; data/late-0.1.0/src/init.cpp:48:7: [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). fin.open(n); data/late-0.1.0/src/init.cpp:58: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 n[200]; data/late-0.1.0/src/scorescreen.cpp:74: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 n [200]; data/late-0.1.0/src/sidebar.cpp:54: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 n [200]; data/late-0.1.0/src/stripmaker.c:21:15: [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). int start = atoi(argv[3]); data/late-0.1.0/src/stripmaker.c:22:16: [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). int finish = atoi(argv[4]); data/late-0.1.0/src/stripmaker.c:24: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 curname[200]; data/late-0.1.0/src/game.cpp:870:7: [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(10); data/late-0.1.0/src/menu.cpp:156:9: [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(50); data/late-0.1.0/src/scorescreen.cpp:59:7: [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(50); ANALYSIS SUMMARY: Hits = 33 Lines analyzed = 4479 in approximately 0.38 seconds (11673 lines/second) Physical Source Lines of Code (SLOC) = 3266 Hits@level = [0] 29 [1] 3 [2] 20 [3] 2 [4] 8 [5] 0 Hits@level+ = [0+] 62 [1+] 33 [2+] 30 [3+] 10 [4+] 8 [5+] 0 Hits/KSLOC@level+ = [0+] 18.9835 [1+] 10.1041 [2+] 9.18555 [3+] 3.06185 [4+] 2.44948 [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.