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/tuxpuck-0.8.2/video.c Examining data/tuxpuck-0.8.2/audio.c Examining data/tuxpuck-0.8.2/menu.c Examining data/tuxpuck-0.8.2/sprite.c Examining data/tuxpuck-0.8.2/font.c Examining data/tuxpuck-0.8.2/timer.c Examining data/tuxpuck-0.8.2/board.c Examining data/tuxpuck-0.8.2/entity.c Examining data/tuxpuck-0.8.2/glass.c Examining data/tuxpuck-0.8.2/scoreboard.c Examining data/tuxpuck-0.8.2/player.c Examining data/tuxpuck-0.8.2/zoom.c Examining data/tuxpuck-0.8.2/jpg.c Examining data/tuxpuck-0.8.2/intro.c Examining data/tuxpuck-0.8.2/tux.c Examining data/tuxpuck-0.8.2/arcana.c Examining data/tuxpuck-0.8.2/tuxpuck.h Examining data/tuxpuck-0.8.2/video.h Examining data/tuxpuck-0.8.2/audio.h Examining data/tuxpuck-0.8.2/font.h Examining data/tuxpuck-0.8.2/utils/data2c.c Examining data/tuxpuck-0.8.2/utils/anim.c Examining data/tuxpuck-0.8.2/utils/ttf2font.c Examining data/tuxpuck-0.8.2/tuxpuck.c Examining data/tuxpuck-0.8.2/png.c FINAL RESULTS: data/tuxpuck-0.8.2/menu.c:134: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(menu->text[position], text); data/tuxpuck-0.8.2/tuxpuck.c:210:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (sscanf(buffer, "%s %d\n", buffer2, &uint32) != 2) { data/tuxpuck-0.8.2/utils/anim.c:68:9: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (fscanf(in, "%s\n", buffer1) != 1) data/tuxpuck-0.8.2/utils/anim.c:70:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer2, "%s%s", argv[1], buffer1); data/tuxpuck-0.8.2/utils/data2c.c:36:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "%s.c", argv[2]); data/tuxpuck-0.8.2/tuxpuck.c:240: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/tuxpuck-0.8.2/tuxpuck.c:252:13: [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. homeDir = getenv("HOME"); data/tuxpuck-0.8.2/audio.c:162:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&size, data, sizeof(Uint32)); data/tuxpuck-0.8.2/entity.c:222:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&puck->entity, e, sizeof(Entity)); data/tuxpuck-0.8.2/font.c:33:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&size, data, sizeof(Uint32)); data/tuxpuck-0.8.2/font.c:44:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&x_size, &data[index], 2); data/tuxpuck-0.8.2/font.c:46:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&y_size, &data[index], 2); data/tuxpuck-0.8.2/font.c:49:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&font->glyph[ch]->x_move, &data[index], 2); data/tuxpuck-0.8.2/font.c:51:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&font->glyph[ch]->y_move, &data[index], 2); data/tuxpuck-0.8.2/font.c:53:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&font->glyph[ch]->advance, &data[index], 2); data/tuxpuck-0.8.2/jpg.c:136:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&size, data, sizeof(Uint32)); data/tuxpuck-0.8.2/png.c:52:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&size, data, sizeof(Uint32)); data/tuxpuck-0.8.2/sprite.c:41:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&time[i], &data[index], sizeof(Uint16)); data/tuxpuck-0.8.2/sprite.c:91:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&size, data, sizeof(Uint32)); data/tuxpuck-0.8.2/tuxpuck.c:35:8: [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. static char _settings_file[200]; data/tuxpuck-0.8.2/tuxpuck.c:45: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 buffer[50]; data/tuxpuck-0.8.2/tuxpuck.c:204: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 buffer[100], buffer2[100]; data/tuxpuck-0.8.2/tuxpuck.c:207:15: [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 ((file = fopen(SETTINGSFILE, "r")) == NULL) data/tuxpuck-0.8.2/tuxpuck.c:227:15: [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 ((file = fopen(SETTINGSFILE, "w")) == NULL) data/tuxpuck-0.8.2/utils/anim.c:29:13: [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 ((in = fopen(filename, "rb")) == NULL) data/tuxpuck-0.8.2/utils/anim.c:45: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 buffer1[100]; data/tuxpuck-0.8.2/utils/anim.c:46: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 buffer2[100]; data/tuxpuck-0.8.2/utils/anim.c:54:13: [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 ((in = fopen(argv[1], "rb")) == NULL) data/tuxpuck-0.8.2/utils/anim.c:56: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 ((out = fopen(argv[2], "wb")) == NULL) data/tuxpuck-0.8.2/utils/data2c.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 buffer[100]; data/tuxpuck-0.8.2/utils/data2c.c:32:13: [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 ((in = fopen(argv[1], "rb")) == NULL) data/tuxpuck-0.8.2/utils/data2c.c:37: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 ((out = fopen(buffer, "wb")) == NULL) data/tuxpuck-0.8.2/utils/ttf2font.c:68:9: [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). out = fopen(argv[2], "wb"); data/tuxpuck-0.8.2/font.c:104:19: [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). for (i = 0; i < strlen(string); i++) data/tuxpuck-0.8.2/font.c:135:19: [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). for (i = 0; i < strlen(string); i++) data/tuxpuck-0.8.2/font.c:147:19: [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). for (i = 0; i < strlen(string); i++) { data/tuxpuck-0.8.2/menu.c:133:33: [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). menu->text[position] = malloc(strlen(text) + 1); data/tuxpuck-0.8.2/utils/anim.c:64:13: [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). argv[1][strlen(argv[1]) - strlen(ptr) + 1] = 0; data/tuxpuck-0.8.2/utils/anim.c:64: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). argv[1][strlen(argv[1]) - strlen(ptr) + 1] = 0; ANALYSIS SUMMARY: Hits = 39 Lines analyzed = 3950 in approximately 0.12 seconds (34151 lines/second) Physical Source Lines of Code (SLOC) = 3319 Hits@level = [0] 23 [1] 6 [2] 26 [3] 2 [4] 5 [5] 0 Hits@level+ = [0+] 62 [1+] 39 [2+] 33 [3+] 7 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 18.6803 [1+] 11.7505 [2+] 9.94275 [3+] 2.10907 [4+] 1.50648 [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.