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/ninvaders-0.1.1/view.c Examining data/ninvaders-0.1.1/view.h Examining data/ninvaders-0.1.1/player.c Examining data/ninvaders-0.1.1/player.h Examining data/ninvaders-0.1.1/globals.h Examining data/ninvaders-0.1.1/aliens.c Examining data/ninvaders-0.1.1/aliens.h Examining data/ninvaders-0.1.1/globals.c Examining data/ninvaders-0.1.1/nInvaders.c Examining data/ninvaders-0.1.1/nInvaders.h Examining data/ninvaders-0.1.1/ufo.c Examining data/ninvaders-0.1.1/ufo.h FINAL RESULTS: data/ninvaders-0.1.1/aliens.c:251:11: [3] (random) random: 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. tmp = random() % ALIENS_MAX_NUMBER_X; // randomly select one of the ... data/ninvaders-0.1.1/aliens.c:253:12: [3] (random) random: 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. tmp = random() % ALIENS_MAX_NUMBER_X; // ...a column to launch missile data/ninvaders-0.1.1/ufo.c:78:8: [3] (random) random: 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. if ((random() % 200) == 0) { data/ninvaders-0.1.1/aliens.c:97: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 bunkerd[BUNKERHEIGHT][BUNKERWIDTH+1] = { data/ninvaders-0.1.1/globals.c:86: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 b[2]; data/ninvaders-0.1.1/globals.c:133:14: [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 (!(GPL = fopen(gpl_file, "r"))) { data/ninvaders-0.1.1/view.c:120: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 playerExplosionChars[16+1]="@~`.,^#*-_=\\/%{}"; data/ninvaders-0.1.1/view.c:208: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 ships[2][9][3+1] = { data/ninvaders-0.1.1/view.c:302: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 ufo[4][6] = {"<o o>", "<oo >", "<o o>", "< oo>"}; data/ninvaders-0.1.1/view.c:399: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 ufo[4][6] = {"<o o>", "<oo >", "<o o>", "< oo>"}; data/ninvaders-0.1.1/view.c:400: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 aliens[2][9][3+1] = { data/ninvaders-0.1.1/view.c:406: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 buffer[12]; data/ninvaders-0.1.1/view.c:485: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 strStatus[55]; data/ninvaders-0.1.1/view.c:494:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (strStatus, "Level: %2.2d Score: %2.7d Lives: ", level, score); data/ninvaders-0.1.1/globals.c:39: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. #define usleep(x) Sleep(x/1000) data/ninvaders-0.1.1/globals.c:48: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(microseconds); ANALYSIS SUMMARY: Hits = 16 Lines analyzed = 2134 in approximately 0.06 seconds (37579 lines/second) Physical Source Lines of Code (SLOC) = 1193 Hits@level = [0] 46 [1] 2 [2] 11 [3] 3 [4] 0 [5] 0 Hits@level+ = [0+] 62 [1+] 16 [2+] 14 [3+] 3 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 51.9698 [1+] 13.4116 [2+] 11.7351 [3+] 2.51467 [4+] 0 [5+] 0 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.