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/tennix-1.1/util.h Examining data/tennix-1.1/credits.h Examining data/tennix-1.1/archive.cc Examining data/tennix-1.1/graphics.h Examining data/tennix-1.1/tennix.h Examining data/tennix-1.1/input.c Examining data/tennix-1.1/sound.cc Examining data/tennix-1.1/graphics.cc Examining data/tennix-1.1/tennixpy.h Examining data/tennix-1.1/animation.h Examining data/tennix-1.1/util.c Examining data/tennix-1.1/input.h Examining data/tennix-1.1/sound.h Examining data/tennix-1.1/SDLMain.h Examining data/tennix-1.1/SDL_rotozoom.h Examining data/tennix-1.1/animation.c Examining data/tennix-1.1/data/data2csrc.c Examining data/tennix-1.1/archivetool.cc Examining data/tennix-1.1/game.c Examining data/tennix-1.1/network.h Examining data/tennix-1.1/locations.h Examining data/tennix-1.1/tennix.cc Examining data/tennix-1.1/SDL_rotozoom.c Examining data/tennix-1.1/network.c Examining data/tennix-1.1/game.h Examining data/tennix-1.1/tennixpy.cc FINAL RESULTS: data/tennix-1.1/archive.cc:148: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(item->filename, filename); data/tennix-1.1/data/data2csrc.c:24: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( filename, argv[1]); data/tennix-1.1/data/data2csrc.c:28:9: [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( varname, argv[1]); data/tennix-1.1/data/data2csrc.c:34:9: [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( varname, argv[2]); data/tennix-1.1/game.c:857:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat( sets, tmp); data/tennix-1.1/game.c:910:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(status, "%d:%d in %s set", data/tennix-1.1/input.c:113:9: [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(devices[devices_count].name, SDL_JoystickName(x)); data/tennix-1.1/game.c:83:18: [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. assert(chdir(getenv("HOME")) == 0); data/tennix-1.1/game.c:135:18: [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. assert(chdir(getenv("HOME")) == 0); data/tennix-1.1/tennix.cc:246:9: [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(100); data/tennix-1.1/tennix.cc:248:9: [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((unsigned)time(NULL)); data/tennix-1.1/archive.cc:42:10: [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). fp = fopen(filename, "rb"); data/tennix-1.1/archive.cc:44: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). fp = fopen(fallback, "rb"); data/tennix-1.1/archive.cc:160:10: [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). fp = fopen(filename, "wb"); data/tennix-1.1/archivetool.cc:60:18: [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). fp = fopen(argv[i], "rb"); data/tennix-1.1/archivetool.cc:91:22: [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). fp = fopen(filename, "wb"); data/tennix-1.1/archivetool.cc:107:22: [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). fp = fopen(filename, "wb"); data/tennix-1.1/data/data2csrc.c:17:5: [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 filename[FILENAME_MAX], varname[FILENAME_MAX]; data/tennix-1.1/data/data2csrc.c:37:10: [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). fp = fopen( filename, "rb"); data/tennix-1.1/game.c:65: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(s, &gs_template, sizeof(GameState)); data/tennix-1.1/game.c:80:5: [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 tmp[MAXPATHLEN]; data/tennix-1.1/game.c:94:10: [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). fp = fopen(filename, "w"); data/tennix-1.1/game.c:132:5: [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 tmp[MAXPATHLEN]; data/tennix-1.1/game.c:138:10: [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). fp = fopen(filename, "r"); data/tennix-1.1/game.c:428:21: [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(&(PLAYER(s, p).input->net), &net_input, data/tennix-1.1/game.c:846:12: [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 sets[100]; data/tennix-1.1/game.c:847:12: [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 tmp[100]; data/tennix-1.1/game.c:856:9: [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( tmp, "%d:%d, ", PLAYER(s, 1).sets[i], PLAYER(s, 2).sets[i]); data/tennix-1.1/game.c:866:12: [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 game[100]; data/tennix-1.1/game.c:879:9: [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( game, "%d - %d", game_scoring[PLAYER(s, 1).game], game_scoring[PLAYER(s, 2).game]); data/tennix-1.1/game.c:884:9: [2] (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). Risk is low because the source is a constant string. strcpy( game, "advantage player 1"); data/tennix-1.1/game.c:889:9: [2] (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). Risk is low because the source is a constant string. strcpy( game, "advantage player 2"); data/tennix-1.1/game.c:894:9: [2] (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). Risk is low because the source is a constant string. strcpy( game, "deuce"); data/tennix-1.1/game.c:901:12: [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 status[100]; data/tennix-1.1/game.h:119:14: [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. unsigned char sets[SETS_TO_WIN*2]; /* score for each set */ data/tennix-1.1/input.c:56:5: [2] (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). Risk is low because the source is a constant string. strcpy(devices[devices_count].name, "Keyboard (WS/DEF)"); data/tennix-1.1/input.c:68:5: [2] (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). Risk is low because the source is a constant string. strcpy(devices[devices_count].name, "Keyboard (OL/KIJ)"); data/tennix-1.1/input.c:81:5: [2] (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). Risk is low because the source is a constant string. strcpy(devices[devices_count].name, "D-Pad"); data/tennix-1.1/input.c:86:5: [2] (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). Risk is low because the source is a constant string. strcpy(devices[devices_count].name, "Keyboard (arrows)"); data/tennix-1.1/input.c:97:5: [2] (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). Risk is low because the source is a constant string. strcpy(devices[devices_count].name, "Touchscreen"); data/tennix-1.1/input.c:100:5: [2] (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). Risk is low because the source is a constant string. strcpy(devices[devices_count].name, "Mouse"); data/tennix-1.1/input.c:107:5: [2] (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). Risk is low because the source is a constant string. strcpy(devices[devices_count].name, "Network player"); data/tennix-1.1/input.h:76:5: [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 name[INPUT_DEVICE_NAME_MAX]; data/tennix-1.1/network.c:105:9: [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(connection->input_packet->data, src, sizeof(NetworkInputData)); data/tennix-1.1/network.c:112:9: [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(&(connection->input_data), src, sizeof(NetworkInputData)); data/tennix-1.1/network.c:153:9: [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(dest, connection->input_packet->data, sizeof(NetworkInputData)); data/tennix-1.1/network.c:211: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(dest->sets, src->sets, sizeof(unsigned char)*(SETS_TO_WIN*2)); data/tennix-1.1/network.c:226: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(dest->sets, src->sets, sizeof(unsigned char)*(SETS_TO_WIN*2)); data/tennix-1.1/network.h:56:14: [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. unsigned char sets[SETS_TO_WIN*2]; data/tennix-1.1/data/data2csrc.c:29:21: [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( varname); i++) { data/tennix-1.1/data/data2csrc.c:41:17: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while( (c = fgetc( fp)) != EOF) { data/tennix-1.1/game.c:860:10: [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). sets[strlen(sets)-2] = '\0'; data/tennix-1.1/tennixpy.cc:193:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dest, PyUnicode_AsUTF8(name), maxlen); data/tennix-1.1/tennixpy.cc:195:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(dest, "<unknown pybot>", maxlen); ANALYSIS SUMMARY: Hits = 54 Lines analyzed = 7419 in approximately 0.19 seconds (38913 lines/second) Physical Source Lines of Code (SLOC) = 5173 Hits@level = [0] 63 [1] 5 [2] 38 [3] 4 [4] 7 [5] 0 Hits@level+ = [0+] 117 [1+] 54 [2+] 49 [3+] 11 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 22.6174 [1+] 10.4388 [2+] 9.47226 [3+] 2.12643 [4+] 1.35318 [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.