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/atanks-6.5~dfsg/src/update.h Examining data/atanks-6.5~dfsg/src/clock.cpp Examining data/atanks-6.5~dfsg/src/explosion.cpp Examining data/atanks-6.5~dfsg/src/missile.h Examining data/atanks-6.5~dfsg/src/teleport.h Examining data/atanks-6.5~dfsg/src/optionitemplayer.cpp Examining data/atanks-6.5~dfsg/src/shop.cpp Examining data/atanks-6.5~dfsg/src/perlin.cpp Examining data/atanks-6.5~dfsg/src/optionscreens.cpp Examining data/atanks-6.5~dfsg/src/beam.cpp Examining data/atanks-6.5~dfsg/src/optiontypes.h Examining data/atanks-6.5~dfsg/src/debris_pool.h Examining data/atanks-6.5~dfsg/src/environment.cpp Examining data/atanks-6.5~dfsg/src/satellite.h Examining data/atanks-6.5~dfsg/src/debug.cpp Examining data/atanks-6.5~dfsg/src/extern/dirent.h Examining data/atanks-6.5~dfsg/src/extern/dirent.c Examining data/atanks-6.5~dfsg/src/aicore.h Examining data/atanks-6.5~dfsg/src/menu.h Examining data/atanks-6.5~dfsg/src/missile.cpp Examining data/atanks-6.5~dfsg/src/optionitembase.h Examining data/atanks-6.5~dfsg/src/button.h Examining data/atanks-6.5~dfsg/src/optionitemcolour.cpp Examining data/atanks-6.5~dfsg/src/tank.h Examining data/atanks-6.5~dfsg/src/optionitembase.cpp Examining data/atanks-6.5~dfsg/src/virtobj.cpp Examining data/atanks-6.5~dfsg/src/globals.h Examining data/atanks-6.5~dfsg/src/optionscreens.h Examining data/atanks-6.5~dfsg/src/gfxData.h Examining data/atanks-6.5~dfsg/src/optionitemmenu.h Examining data/atanks-6.5~dfsg/src/sound.cpp Examining data/atanks-6.5~dfsg/src/client.h Examining data/atanks-6.5~dfsg/src/aicore.cpp Examining data/atanks-6.5~dfsg/src/clock.h Examining data/atanks-6.5~dfsg/src/beam.h Examining data/atanks-6.5~dfsg/src/menu.cpp Examining data/atanks-6.5~dfsg/src/land.cpp Examining data/atanks-6.5~dfsg/src/sky.cpp Examining data/atanks-6.5~dfsg/src/winclock.h Examining data/atanks-6.5~dfsg/src/land.h Examining data/atanks-6.5~dfsg/src/gameloop.h Examining data/atanks-6.5~dfsg/src/physobj.cpp Examining data/atanks-6.5~dfsg/src/teleport.cpp Examining data/atanks-6.5~dfsg/src/shop.h Examining data/atanks-6.5~dfsg/src/externs.h Examining data/atanks-6.5~dfsg/src/optionitem.h Examining data/atanks-6.5~dfsg/src/globaltypes.h Examining data/atanks-6.5~dfsg/src/files.cpp Examining data/atanks-6.5~dfsg/src/physobj.h Examining data/atanks-6.5~dfsg/src/explosion.h Examining data/atanks-6.5~dfsg/src/client.cpp Examining data/atanks-6.5~dfsg/src/globaldata.h Examining data/atanks-6.5~dfsg/src/network.cpp Examining data/atanks-6.5~dfsg/src/text.h Examining data/atanks-6.5~dfsg/src/gameloop.cpp Examining data/atanks-6.5~dfsg/src/main.cpp Examining data/atanks-6.5~dfsg/src/sound.h Examining data/atanks-6.5~dfsg/src/debris_pool.cpp Examining data/atanks-6.5~dfsg/src/globaldata.cpp Examining data/atanks-6.5~dfsg/src/decor.cpp Examining data/atanks-6.5~dfsg/src/player_types.cpp Examining data/atanks-6.5~dfsg/src/floattext.cpp Examining data/atanks-6.5~dfsg/src/satellite.cpp Examining data/atanks-6.5~dfsg/src/sky.h Examining data/atanks-6.5~dfsg/src/player.h Examining data/atanks-6.5~dfsg/src/optionitemplayer.h Examining data/atanks-6.5~dfsg/src/optionitemcolour.h Examining data/atanks-6.5~dfsg/src/optioncontent.h Examining data/atanks-6.5~dfsg/src/resource.h Examining data/atanks-6.5~dfsg/src/button.cpp Examining data/atanks-6.5~dfsg/src/player.cpp Examining data/atanks-6.5~dfsg/src/optionitemmenu.cpp Examining data/atanks-6.5~dfsg/src/network.h Examining data/atanks-6.5~dfsg/src/gfxData.cpp Examining data/atanks-6.5~dfsg/src/floattext.h Examining data/atanks-6.5~dfsg/src/text.cpp Examining data/atanks-6.5~dfsg/src/virtobj.h Examining data/atanks-6.5~dfsg/src/player_types.h Examining data/atanks-6.5~dfsg/src/optiontypes.cpp Examining data/atanks-6.5~dfsg/src/atanks.cpp Examining data/atanks-6.5~dfsg/src/globaltypes.cpp Examining data/atanks-6.5~dfsg/src/update.cpp Examining data/atanks-6.5~dfsg/src/tank.cpp Examining data/atanks-6.5~dfsg/src/decor.h Examining data/atanks-6.5~dfsg/src/debug.h Examining data/atanks-6.5~dfsg/src/environment.h Examining data/atanks-6.5~dfsg/src/files.h Examining data/atanks-6.5~dfsg/src/main.h Examining data/atanks-6.5~dfsg/exporter/move.cpp Examining data/atanks-6.5~dfsg/exporter/export.cpp FINAL RESULTS: data/atanks-6.5~dfsg/exporter/move.cpp:29:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(command); data/atanks-6.5~dfsg/src/debug.h:40:5: [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(target, char_count, fmt, __VA_ARGS__) data/atanks-6.5~dfsg/src/debug.h:43:46: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. # define vsprintf_s(tgt, size, fmt, listvar) vsprintf(tgt, fmt, listvar) data/atanks-6.5~dfsg/src/environment.cpp:373:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path_buf, R_OK)) data/atanks-6.5~dfsg/src/environment.cpp:384:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path_buf, R_OK)) data/atanks-6.5~dfsg/src/environment.cpp:393:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path_buf, R_OK)) data/atanks-6.5~dfsg/src/environment.cpp:1099:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. while ( !access(path_buf, F_OK | R_OK) && bitmap_array ) { data/atanks-6.5~dfsg/src/environment.cpp:1289:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path_buf, R_OK)) { data/atanks-6.5~dfsg/src/files.cpp:97:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path_buf, F_OK) && !access(path_buf, W_OK)) data/atanks-6.5~dfsg/src/files.cpp:97:34: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path_buf, F_OK) && !access(path_buf, W_OK)) data/atanks-6.5~dfsg/src/files.cpp:297:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path_buf, R_OK)) data/atanks-6.5~dfsg/src/files.cpp:324:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(dest_path, R_OK | W_OK)) data/atanks-6.5~dfsg/src/main.h:123:11: [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. # define snprintf atanks_snprintf data/atanks-6.5~dfsg/src/main.h:126:11: [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. # define sscanf sscanf_s data/atanks-6.5~dfsg/src/main.h:127:11: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. # define access _access data/atanks-6.5~dfsg/src/network.cpp:348:6: [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(my_message->text, buffer); data/atanks-6.5~dfsg/src/network.h:78:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buffer, fmt_, __VA_ARGS__); \ data/atanks-6.5~dfsg/src/optionitembase.h:142:4: [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(txt_buf, 255, format, *target); data/atanks-6.5~dfsg/src/optionitembase.h:158:23: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define EMERGENCY_OUT fprintf(stderr, \ data/atanks-6.5~dfsg/src/player.cpp:899:13: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. } while (!access(path_buf, F_OK)); data/atanks-6.5~dfsg/src/player.cpp:2606:2: [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(pText, tLen, line, shocker->getName()); data/atanks-6.5~dfsg/src/atanks.cpp:668:2: [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/atanks-6.5~dfsg/src/environment.cpp:347:19: [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. char* homedir = getenv(HOME_DIR); data/atanks-6.5~dfsg/src/files.cpp:327:32: [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. char* my_home_folder = getenv(HOME_DIR); data/atanks-6.5~dfsg/exporter/export.cpp:13:4: [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[256]; data/atanks-6.5~dfsg/exporter/export.cpp:40: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(filename, "%d.bmp", counter); data/atanks-6.5~dfsg/exporter/move.cpp:8:4: [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 command[256]; data/atanks-6.5~dfsg/exporter/move.cpp:28:7: [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(command, "mv %d.bmp %d.bmp", current, current + 1); data/atanks-6.5~dfsg/src/atanks.cpp:56: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 fullPath[PATH_MAX + 1] = { 0 }; data/atanks-6.5~dfsg/src/atanks.cpp:187: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 noHumanMsg[200] = { 0 }; data/atanks-6.5~dfsg/src/atanks.cpp:241:9: [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 return_string[257] = { 0 }; data/atanks-6.5~dfsg/src/atanks.cpp:249: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 head_name[5] = "Name"; data/atanks-6.5~dfsg/src/atanks.cpp:250: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 head_value[6] = "Value"; data/atanks-6.5~dfsg/src/atanks.cpp:251: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 head_score[30] = { 0 }; data/atanks-6.5~dfsg/src/atanks.cpp:292: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 valTxt[16] = { 0 }; data/atanks-6.5~dfsg/src/atanks.cpp:299: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 scoTxt[30] = { 0 }; data/atanks-6.5~dfsg/src/atanks.cpp:739:27: [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). FILE* old_config_file = fopen(fullPath, "r"); data/atanks-6.5~dfsg/src/atanks.cpp:1318:4: [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[256] = { 0 }; data/atanks-6.5~dfsg/src/atanks.cpp:1356: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 noNetworkMsg[200] = { 0 }; data/atanks-6.5~dfsg/src/atanks.cpp:1411: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). FILE* file = fopen(path, "w"); data/atanks-6.5~dfsg/src/beam.cpp:57: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[256]; data/atanks-6.5~dfsg/src/beam.cpp:58: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(buffer, "BEAM %d %d %d %d", (int) x_, (int) y_, fireAngle, weaponType); data/atanks-6.5~dfsg/src/client.cpp:28:4: [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 args[CLIENT_ARGS][BUFFER_SIZE]; data/atanks-6.5~dfsg/src/client.cpp:123: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. char some_text[32]; data/atanks-6.5~dfsg/src/client.cpp:135:11: [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(some_text, "%d", health); data/atanks-6.5~dfsg/src/client.cpp:138:11: [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(some_text, "%d", shield); data/atanks-6.5~dfsg/src/client.cpp:399:4: [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[256]; data/atanks-6.5~dfsg/src/client.cpp:518: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 buffer[BUFFER_SIZE]; data/atanks-6.5~dfsg/src/client.cpp:601:49: [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. case CLIENT_SCREEN: strcpy(buffer, "SCREEN"); break; data/atanks-6.5~dfsg/src/client.cpp:602:47: [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. case CLIENT_WIND: strcpy(buffer, "WIND"); break; data/atanks-6.5~dfsg/src/client.cpp:603:53: [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. case CLIENT_NUMPLAYERS: strcpy(buffer, "NUMPLAYERS"); break; data/atanks-6.5~dfsg/src/client.cpp:604:56: [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. case CLIENT_TANK_POSITION: strcpy(buffer, "TANKPOSITION 0"); break; data/atanks-6.5~dfsg/src/client.cpp:605:50: [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. case CLIENT_SURFACE: strcpy(buffer, "SURFACE 0"); break; data/atanks-6.5~dfsg/src/client.cpp:606:49: [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. case CLIENT_WHOAMI: strcpy(buffer, "WHOAMI"); break; data/atanks-6.5~dfsg/src/client.cpp:607:50: [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. case CLIENT_WEAPONS: strcpy(buffer, "WEAPON 0"); break; data/atanks-6.5~dfsg/src/client.cpp:608:50: [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. case CLIENT_ITEMS: strcpy(buffer, "ITEM 0"); break; data/atanks-6.5~dfsg/src/client.cpp:609:49: [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. case CLIENT_ROUNDS: strcpy(buffer, "ROUNDS"); break; data/atanks-6.5~dfsg/src/client.cpp:610:48: [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. case CLIENT_TEAMS: strcpy(buffer, "TEAMS 0"); data/atanks-6.5~dfsg/src/client.cpp:612:52: [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. case CLIENT_WALL_TYPE: strcpy(buffer, "WALLTYPE"); break; data/atanks-6.5~dfsg/src/client.cpp:613:48: [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. case CLIENT_BOXED: strcpy(buffer, "BOXED"); break; data/atanks-6.5~dfsg/src/client.cpp:614:47: [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. case CLIENT_NAME: strcpy(buffer, "PLAYERNAME 0"); break; data/atanks-6.5~dfsg/src/client.cpp:615:54: [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. case CLIENT_TANK_HEALTH: strcpy(buffer, "HEALTH 0"); break; data/atanks-6.5~dfsg/src/debug.cpp:22: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 timebuf[21]; data/atanks-6.5~dfsg/src/debug.cpp:25: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 xMsg[512]; data/atanks-6.5~dfsg/src/debug.cpp:48: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). FILE* out = fopen("atanks.log", "a"); data/atanks-6.5~dfsg/src/debug.h:77:6: [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 _atanks_fname_info[64]; \ data/atanks-6.5~dfsg/src/debug.h:78:6: [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 _atanks_extension[8]; \ data/atanks-6.5~dfsg/src/debug.h:105:4: [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 _atanks_trace_info[256]; \ data/atanks-6.5~dfsg/src/environment.cpp:643: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 line[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/environment.cpp:644: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 field[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/environment.cpp:645: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 value[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/environment.cpp:929: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 suffix[12] = { 0 }; data/atanks-6.5~dfsg/src/environment.cpp:1071: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 sub_folder[9] = { 0 }; data/atanks-6.5~dfsg/src/environment.h:150: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 configDir[PATH_MAX + 1]; data/atanks-6.5~dfsg/src/environment.h:153: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 dataDir[PATH_MAX + 1]; data/atanks-6.5~dfsg/src/environment.h:169: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 game_name[GAMENAMELEN + 1]; data/atanks-6.5~dfsg/src/environment.h:222: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 server_name[129]; data/atanks-6.5~dfsg/src/environment.h:223: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 server_port[129]; data/atanks-6.5~dfsg/src/externs.h:50: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. extern char buf[100]; data/atanks-6.5~dfsg/src/files.cpp:32:1: [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 path_buf[PATH_MAX + 1]; data/atanks-6.5~dfsg/src/files.cpp:46:20: [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). FILE* game_file = fopen(path_buf, "w"); data/atanks-6.5~dfsg/src/files.cpp:114: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 line[ MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/files.cpp:115: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 field[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/files.cpp:116: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 value[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/files.cpp:132:20: [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). FILE* game_file = fopen(path_buf, "r"); data/atanks-6.5~dfsg/src/files.cpp:315:9: [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 xHere[2] = "."; data/atanks-6.5~dfsg/src/files.cpp:318: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 source_path[PATH_MAX + 1] = { 0 }; data/atanks-6.5~dfsg/src/files.cpp:319: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 dest_path[PATH_MAX + 1] = { 0 }; data/atanks-6.5~dfsg/src/files.cpp:320: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[PATH_MAX + 1] = { 0 }; data/atanks-6.5~dfsg/src/files.cpp:350:16: [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). source_file = fopen(source_path, "r"); data/atanks-6.5~dfsg/src/files.cpp:355: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). dest_file = fopen(dest_path, "wb"); data/atanks-6.5~dfsg/src/files.cpp:514:16: [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). FILE* wfile = fopen(path_buf, "r"); data/atanks-6.5~dfsg/src/files.cpp:522: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 line[512] = { 0 }; data/atanks-6.5~dfsg/src/files.cpp:769: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(my_list[file_count], one_file, sizeof(dirent)); data/atanks-6.5~dfsg/src/files.h:27: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. extern char path_buf[PATH_MAX + 1]; data/atanks-6.5~dfsg/src/gameloop.cpp:657: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[64]; data/atanks-6.5~dfsg/src/gameloop.cpp:658: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(buffer, "WIND %f", global.wind); data/atanks-6.5~dfsg/src/gameloop.cpp:1817: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 head_name[5] = "Name"; data/atanks-6.5~dfsg/src/gameloop.cpp:1818: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 head_score[30] = { 0 }; data/atanks-6.5~dfsg/src/gameloop.cpp:1828:4: [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 scoTxt[30] = { 0 }; data/atanks-6.5~dfsg/src/globaldata.cpp:256: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 (lastUpdates, updates, sizeof (BOX) * updateCount); data/atanks-6.5~dfsg/src/globaldata.cpp:638: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 line[ MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/globaldata.cpp:639: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 field[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/globaldata.cpp:640: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 value[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/globaldata.h:193: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 tank_status[128]; data/atanks-6.5~dfsg/src/globals.h:17:1: [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 buf[100]; // buffer for general use data/atanks-6.5~dfsg/src/land.cpp:129:4: [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 (depthStrip[0], depthStrip[1], env.screenHeight * sizeof(double)); data/atanks-6.5~dfsg/src/main.h:376: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 desc[MAX_ITEM_DESC_LEN + 1]; data/atanks-6.5~dfsg/src/main.h:377: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 name[MAX_ITEM_NAME_LEN + 1]; data/atanks-6.5~dfsg/src/main.h:426: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 desc[MAX_ITEM_DESC_LEN + 1]; data/atanks-6.5~dfsg/src/main.h:427: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 name[MAX_ITEM_NAME_LEN + 1]; data/atanks-6.5~dfsg/src/missile.cpp:47: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[256]; data/atanks-6.5~dfsg/src/missile.cpp:48: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(buffer, "MISSILE %d %d %lf %lf %d", data/atanks-6.5~dfsg/src/network.cpp:278:4: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy((char *) server->h_addr, data/atanks-6.5~dfsg/src/network.cpp:314: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 buffer[MAX_MESSAGE_LENGTH]; data/atanks-6.5~dfsg/src/network.cpp:331: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[MAX_MESSAGE_LENGTH]; data/atanks-6.5~dfsg/src/network.cpp:445: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[7] = { 0 }; data/atanks-6.5~dfsg/src/optionitembase.h:141:4: [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 txt_buf[256] = { 0x0 }; data/atanks-6.5~dfsg/src/player.cpp:972:4: [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[NET_COMMAND_SIZE]; data/atanks-6.5~dfsg/src/player.cpp:1021:7: [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[32]; data/atanks-6.5~dfsg/src/player.cpp:1032: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. char buffer[64]; data/atanks-6.5~dfsg/src/player.cpp:1047: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. char buffer[32]; data/atanks-6.5~dfsg/src/player.cpp:1101: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. char buffer[128]; data/atanks-6.5~dfsg/src/player.cpp:1120:7: [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[64]; data/atanks-6.5~dfsg/src/player.cpp:1127:7: [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[32]; data/atanks-6.5~dfsg/src/player.cpp:1133:7: [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[128]; data/atanks-6.5~dfsg/src/player.cpp:1143: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. char buffer[64]; data/atanks-6.5~dfsg/src/player.cpp:1150:7: [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[64]; data/atanks-6.5~dfsg/src/player.cpp:1164: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[32]; data/atanks-6.5~dfsg/src/player.cpp:1179:7: [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[64]; data/atanks-6.5~dfsg/src/player.cpp:1186:7: [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[32]; data/atanks-6.5~dfsg/src/player.cpp:1195:7: [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[32]; data/atanks-6.5~dfsg/src/player.cpp:1200:7: [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[32]; data/atanks-6.5~dfsg/src/player.cpp:1775:9: [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 team_name[9] = { 0 }; data/atanks-6.5~dfsg/src/player.cpp:1997: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 line[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/player.cpp:1998: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 field[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/player.cpp:1999: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 value[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/player.cpp:2130: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 line[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/player.cpp:2131: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 field[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/player.cpp:2132: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 value[MAX_CONFIG_LINE + 1] = { 0 }; data/atanks-6.5~dfsg/src/player.cpp:2971: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 existsMessage[200]; data/atanks-6.5~dfsg/src/player.h:163: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 net_command[NET_COMMAND_SIZE] = { 0 }; data/atanks-6.5~dfsg/src/player.h:199: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 name[NAME_LEN + 1]; data/atanks-6.5~dfsg/src/player.h:230: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 name[NAME_LEN]; data/atanks-6.5~dfsg/src/shop.cpp:29: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 buf[50] = { 0 }; data/atanks-6.5~dfsg/src/shop.cpp:30: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 description[1024] = { 0x20, 0x0 }; data/atanks-6.5~dfsg/src/shop.cpp:895:9: [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 buf_cost[50] = { 0 }; data/atanks-6.5~dfsg/src/shop.cpp:896:9: [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 buf_amt[50] = { 0 }; data/atanks-6.5~dfsg/src/tank.cpp:431: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 the_money[16] = { 0x0 }; data/atanks-6.5~dfsg/src/tank.cpp:521:10: [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 buf[10] = { 0x0 }; data/atanks-6.5~dfsg/src/tank.cpp:852:9: [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 buffer[15] = { 0x0 }; data/atanks-6.5~dfsg/src/tank.cpp:1409:9: [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 buf[10] = { 0x0 }; data/atanks-6.5~dfsg/src/tank.cpp:1470:9: [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 buf[5] = { 0x0 }; data/atanks-6.5~dfsg/src/tank.cpp:1681:9: [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 buf[6] = { 0x0 }; data/atanks-6.5~dfsg/src/teleport.cpp:129: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[64] = { 0x0 }; data/atanks-6.5~dfsg/src/text.cpp:75: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[1024] = { 0 }; data/atanks-6.5~dfsg/src/text.cpp:157: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 line[MAX_LINE_LENGTH] = { 0 }; data/atanks-6.5~dfsg/src/text.cpp:162: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). FILE* fIn = fopen(filename, "r"); data/atanks-6.5~dfsg/src/text.cpp:267:9: [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 return_value[128] = { 0 }; data/atanks-6.5~dfsg/src/text.cpp:271: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[15] = { 0 }; data/atanks-6.5~dfsg/src/update.cpp:51: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[1024]; data/atanks-6.5~dfsg/src/update.cpp:66:3: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy((char*) server->h_addr, data/atanks-6.5~dfsg/src/update.h:14: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 update_string[1024]; data/atanks-6.5~dfsg/src/atanks.cpp:206:4: [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(noHumanMsg, "Please create at least one human player!", 199); data/atanks-6.5~dfsg/src/atanks.cpp:1165:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env.dataDir, next_arg.c_str(), PATH_MAX); data/atanks-6.5~dfsg/src/atanks.cpp:1180:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env.configDir, next_arg.c_str(), PATH_MAX); data/atanks-6.5~dfsg/src/atanks.cpp:1281:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env.game_name, env.ingame->Get_Line(53), GAMENAMELEN); data/atanks-6.5~dfsg/src/atanks.cpp:1324:5: [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(buffer, "GAMEEND", 255); data/atanks-6.5~dfsg/src/client.cpp:31:22: [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). int line_length = strlen(buffer); data/atanks-6.5~dfsg/src/client.cpp:554:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes_read = read(socket_number, buffer, BUFFER_SIZE); data/atanks-6.5~dfsg/src/client.cpp:577:26: [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). if ( strlen(buffer) > 7) data/atanks-6.5~dfsg/src/client.cpp:618:36: [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). towrite = strlen(buffer); data/atanks-6.5~dfsg/src/client.cpp:619:65: [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). written = write(socket_number, buffer, strlen(buffer)); data/atanks-6.5~dfsg/src/environment.cpp:51:2: [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(server_name, "127.0.0.1", 127); data/atanks-6.5~dfsg/src/environment.cpp:52:2: [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(server_port, "25645", 127); data/atanks-6.5~dfsg/src/environment.cpp:385:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dataDir, DATA_DIR, PATH_MAX); data/atanks-6.5~dfsg/src/environment.cpp:390:4: [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(path_buf, "./unicode.dat", PATH_MAX); data/atanks-6.5~dfsg/src/environment.cpp:394:5: [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 character. strncpy(dataDir, ".", PATH_MAX); data/atanks-6.5~dfsg/src/environment.cpp:399:6: [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). if (strlen(dataDir)) data/atanks-6.5~dfsg/src/environment.cpp:676:26: [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). int32_t line_length = strlen(line); data/atanks-6.5~dfsg/src/environment.cpp:695:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(field, line, equal_position); data/atanks-6.5~dfsg/src/environment.cpp:696:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(value, & (line[equal_position + 1]), 127); data/atanks-6.5~dfsg/src/environment.cpp:933:4: [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(suffix, "_fr.txt", 11); data/atanks-6.5~dfsg/src/environment.cpp:937:4: [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(suffix, "_de.txt", 11); data/atanks-6.5~dfsg/src/environment.cpp:941:4: [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(suffix, "_it.txt", 11); data/atanks-6.5~dfsg/src/environment.cpp:945:4: [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(suffix, ".pt_BR.txt", 11); data/atanks-6.5~dfsg/src/environment.cpp:949:4: [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(suffix, "_ru.txt", 11); data/atanks-6.5~dfsg/src/environment.cpp:953:4: [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(suffix, "_sk.txt", 11); data/atanks-6.5~dfsg/src/environment.cpp:957:4: [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(suffix, "_ES.txt", 11); data/atanks-6.5~dfsg/src/environment.cpp:962:4: [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(suffix, ".txt", 11); // default to english data/atanks-6.5~dfsg/src/environment.cpp:1078:12: [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. case 0: strncpy(sub_folder, "title", 8); break; data/atanks-6.5~dfsg/src/environment.cpp:1079:12: [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. case 1: strncpy(sub_folder, "button", 8); break; data/atanks-6.5~dfsg/src/environment.cpp:1080:12: [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. case 2: strncpy(sub_folder, "misc", 8); break; data/atanks-6.5~dfsg/src/environment.cpp:1081:12: [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. case 3: strncpy(sub_folder, "missile", 8); break; data/atanks-6.5~dfsg/src/environment.cpp:1082:12: [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. case 4: strncpy(sub_folder, "stock", 8); break; data/atanks-6.5~dfsg/src/environment.cpp:1083:12: [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. case 5: strncpy(sub_folder, "tank", 8); break; data/atanks-6.5~dfsg/src/environment.cpp:1084:12: [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. case 6: strncpy(sub_folder, "tankgun", 8); break; data/atanks-6.5~dfsg/src/environment.cpp:1428:2: [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(server_name, "127.0.0.1", 127); data/atanks-6.5~dfsg/src/environment.cpp:1429:2: [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(server_port, "25645", 127); data/atanks-6.5~dfsg/src/environment.cpp:1522: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). int32_t message_length = strlen(message); data/atanks-6.5~dfsg/src/extern/dirent.c:38:30: [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). size_t base_length = strlen(name); data/atanks-6.5~dfsg/src/extern/dirent.c:43:18: [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). full_length += strlen(all) + 1; data/atanks-6.5~dfsg/src/files.cpp:151:26: [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). int32_t line_length = strlen(line); data/atanks-6.5~dfsg/src/files.cpp:180:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(field, line, equal_position); data/atanks-6.5~dfsg/src/files.cpp:181:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(value, &( line[equal_position + 1] ), MAX_CONFIG_LINE); data/atanks-6.5~dfsg/src/files.cpp:538:35: [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). if ( (! (line[0] == '#') ) && ( strlen(line) > 2 ) ) { data/atanks-6.5~dfsg/src/files.cpp:815:18: [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). size_t nLen = strlen(env.configDir) data/atanks-6.5~dfsg/src/files.cpp:816:18: [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(one_file->d_name) + 16; data/atanks-6.5~dfsg/src/floattext.cpp:300:24: [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). int new_len = text_ ? strlen(text_) : 0; data/atanks-6.5~dfsg/src/floattext.cpp:301:24: [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). int old_len = text ? strlen(text) : 0; data/atanks-6.5~dfsg/src/floattext.cpp:322:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(text, text_, new_len); data/atanks-6.5~dfsg/src/globaldata.cpp:666:26: [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). int32_t line_length = strlen(line); data/atanks-6.5~dfsg/src/globaldata.cpp:685:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(field, line, equal_position); data/atanks-6.5~dfsg/src/globaldata.cpp:686:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(value, &( line[equal_position + 1] ), MAX_CONFIG_LINE); data/atanks-6.5~dfsg/src/main.cpp:102:6: [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). if (strlen(desc_) > MAX_ITEM_DESC_LEN) data/atanks-6.5~dfsg/src/main.cpp:104:36: [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). name, MAX_ITEM_DESC_LEN, strlen(desc_)); data/atanks-6.5~dfsg/src/main.cpp:105:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(desc, desc_, MAX_ITEM_DESC_LEN); data/atanks-6.5~dfsg/src/main.cpp:112:6: [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). if (strlen(name_) > MAX_ITEM_NAME_LEN) data/atanks-6.5~dfsg/src/main.cpp:114:37: [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). name_, MAX_ITEM_NAME_LEN, strlen(name_)); data/atanks-6.5~dfsg/src/main.cpp:115:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, name_, MAX_ITEM_NAME_LEN); data/atanks-6.5~dfsg/src/main.cpp:143:6: [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). if (strlen(desc_) > MAX_ITEM_DESC_LEN) data/atanks-6.5~dfsg/src/main.cpp:145:30: [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). name, MAX_ITEM_DESC_LEN, strlen(desc_)); data/atanks-6.5~dfsg/src/main.cpp:146:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(desc, desc_, MAX_ITEM_DESC_LEN); data/atanks-6.5~dfsg/src/main.cpp:152:6: [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). if (strlen(name_) > MAX_ITEM_NAME_LEN) data/atanks-6.5~dfsg/src/main.cpp:154:37: [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). name_, MAX_ITEM_NAME_LEN, strlen(name_)); data/atanks-6.5~dfsg/src/main.cpp:155:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, name_, MAX_ITEM_NAME_LEN); data/atanks-6.5~dfsg/src/main.h:124:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). # define strncpy(d, s, c) strncpy_s(d, c+1, s, c) data/atanks-6.5~dfsg/src/main.h:125:11: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. # define strncat(d, s, c) strncat_s(d, c+1, s, c) data/atanks-6.5~dfsg/src/network.cpp:51:42: [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). new_message->text = (char *) calloc( strlen(some_text) + 1, sizeof(char) ); data/atanks-6.5~dfsg/src/network.cpp:59:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(new_message->text, some_text, strlen(some_text)); data/atanks-6.5~dfsg/src/network.cpp:59:40: [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). strncpy(new_message->text, some_text, strlen(some_text)); data/atanks-6.5~dfsg/src/network.cpp:109:40: [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). my_message->text = (char *) calloc( strlen(first_message->text) + 1, sizeof(char) ); data/atanks-6.5~dfsg/src/network.cpp:117:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(my_message->text, first_message->text, strlen(first_message->text)); data/atanks-6.5~dfsg/src/network.cpp:117:51: [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). strncpy(my_message->text, first_message->text, strlen(first_message->text)); data/atanks-6.5~dfsg/src/network.cpp:155:41: [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). my_message->text = (char *) calloc( strlen(current->text) + 1, sizeof(char)); data/atanks-6.5~dfsg/src/network.cpp:163:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(my_message->text, current->text, strlen(current->text)); data/atanks-6.5~dfsg/src/network.cpp:163:43: [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). strncpy(my_message->text, current->text, strlen(current->text)); data/atanks-6.5~dfsg/src/network.cpp:316:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, mess->text, MAX_MESSAGE_LENGTH); data/atanks-6.5~dfsg/src/network.cpp:318:39: [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). status = write(to_socket, buffer, strlen(buffer) ); data/atanks-6.5~dfsg/src/network.cpp:338:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes_read = read(from_socket, buffer, MAX_MESSAGE_LENGTH); data/atanks-6.5~dfsg/src/network.cpp:342:42: [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). my_message->text = (char *) calloc( strlen(buffer), sizeof(char) ); data/atanks-6.5~dfsg/src/network.h:79:12: [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). towrite = strlen(buffer); \ data/atanks-6.5~dfsg/src/optionitembase.cpp:510:24: [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). int32_t oldTextLen = strlen(target); data/atanks-6.5~dfsg/src/optionitembase.h:143:14: [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). textLen = strlen(txt_buf); data/atanks-6.5~dfsg/src/optionitembase.h:146:14: [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). textLen = strlen(texts[entryNum]); data/atanks-6.5~dfsg/src/optionscreens.cpp:384:2: [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(env.game_name, "New Game", GAMENAMELEN); data/atanks-6.5~dfsg/src/optionscreens.cpp:514:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env.game_name, data/atanks-6.5~dfsg/src/player.cpp:53:2: [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(name, "New Player", NAME_LEN); data/atanks-6.5~dfsg/src/player.cpp:1736:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t status = read(server_socket, net_command, NET_COMMAND_SIZE); data/atanks-6.5~dfsg/src/player.cpp:2027:26: [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). int32_t line_length = strlen(line); data/atanks-6.5~dfsg/src/player.cpp:2046:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(field, line, equal_position); data/atanks-6.5~dfsg/src/player.cpp:2047:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(value, &( line[equal_position + 1] ), MAX_CONFIG_LINE); data/atanks-6.5~dfsg/src/player.cpp:2051:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, value, NAME_LEN); data/atanks-6.5~dfsg/src/player.cpp:2152:26: [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). int32_t line_length = strlen(line); data/atanks-6.5~dfsg/src/player.cpp:2171:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(field, line, equal_position); data/atanks-6.5~dfsg/src/player.cpp:2172:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(value, &( line[equal_position + 1] ), MAX_CONFIG_LINE); data/atanks-6.5~dfsg/src/player.cpp:2600:22: [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). size_t tLen = strlen(shocker->getName()) + strlen(line); data/atanks-6.5~dfsg/src/player.cpp:2600:51: [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). size_t tLen = strlen(shocker->getName()) + strlen(line); data/atanks-6.5~dfsg/src/player.cpp:2626:22: [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). size_t tLen = strlen(rname) + 4 + strlen(line); data/atanks-6.5~dfsg/src/player.cpp:2626:42: [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). size_t tLen = strlen(rname) + 4 + strlen(line); data/atanks-6.5~dfsg/src/player.cpp:2660:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (name, name_, NAME_LEN - 1); data/atanks-6.5~dfsg/src/player.cpp:2743:2: [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(name, "New Player", NAME_LEN); data/atanks-6.5~dfsg/src/player.cpp:2754:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, source->getName(), NAME_LEN); data/atanks-6.5~dfsg/src/shop.cpp:288:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(description, env.ingame->Get_Line(41), 1023); data/atanks-6.5~dfsg/src/text.cpp:80:48: [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). uint32_t textLength = static_cast<uint32_t>(strlen(text)); data/atanks-6.5~dfsg/src/text.cpp:196:47: [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). complete_text[lines_loaded] = (char*)calloc(strlen(line) + 1, sizeof(char)); data/atanks-6.5~dfsg/src/text.cpp:199:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(complete_text[lines_loaded++], line, strlen(line)); data/atanks-6.5~dfsg/src/text.cpp:199:49: [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). strncpy(complete_text[lines_loaded++], line, strlen(line)); data/atanks-6.5~dfsg/src/text.cpp:274:24: [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). int32_t index = strlen(buffer); // start from the end data/atanks-6.5~dfsg/src/update.cpp:80:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). got_bytes = read(socket_num, buffer, 1024); data/atanks-6.5~dfsg/src/update.cpp:86:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). got_bytes = read(socket_num, buffer, 1024); ANALYSIS SUMMARY: Hits = 271 Lines analyzed = 41262 in approximately 1.12 seconds (36806 lines/second) Physical Source Lines of Code (SLOC) = 26731 Hits@level = [0] 451 [1] 108 [2] 139 [3] 3 [4] 21 [5] 0 Hits@level+ = [0+] 722 [1+] 271 [2+] 163 [3+] 24 [4+] 21 [5+] 0 Hits/KSLOC@level+ = [0+] 27.0098 [1+] 10.138 [2+] 6.09779 [3+] 0.897834 [4+] 0.785605 [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.