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/freedroidrpg-1.0~rc2/lua/lapi.c Examining data/freedroidrpg-1.0~rc2/lua/lapi.h Examining data/freedroidrpg-1.0~rc2/lua/lauxlib.c Examining data/freedroidrpg-1.0~rc2/lua/lauxlib.h Examining data/freedroidrpg-1.0~rc2/lua/lbaselib.c Examining data/freedroidrpg-1.0~rc2/lua/lbitlib.c Examining data/freedroidrpg-1.0~rc2/lua/lcode.c Examining data/freedroidrpg-1.0~rc2/lua/lcode.h Examining data/freedroidrpg-1.0~rc2/lua/lcorolib.c Examining data/freedroidrpg-1.0~rc2/lua/lctype.c Examining data/freedroidrpg-1.0~rc2/lua/lctype.h Examining data/freedroidrpg-1.0~rc2/lua/ldblib.c Examining data/freedroidrpg-1.0~rc2/lua/ldebug.c Examining data/freedroidrpg-1.0~rc2/lua/ldebug.h Examining data/freedroidrpg-1.0~rc2/lua/ldo.c Examining data/freedroidrpg-1.0~rc2/lua/ldo.h Examining data/freedroidrpg-1.0~rc2/lua/ldump.c Examining data/freedroidrpg-1.0~rc2/lua/lfunc.c Examining data/freedroidrpg-1.0~rc2/lua/lfunc.h Examining data/freedroidrpg-1.0~rc2/lua/lgc.c Examining data/freedroidrpg-1.0~rc2/lua/lgc.h Examining data/freedroidrpg-1.0~rc2/lua/linit.c Examining data/freedroidrpg-1.0~rc2/lua/liolib.c Examining data/freedroidrpg-1.0~rc2/lua/llex.c Examining data/freedroidrpg-1.0~rc2/lua/llex.h Examining data/freedroidrpg-1.0~rc2/lua/llimits.h Examining data/freedroidrpg-1.0~rc2/lua/lmathlib.c Examining data/freedroidrpg-1.0~rc2/lua/lmem.c Examining data/freedroidrpg-1.0~rc2/lua/lmem.h Examining data/freedroidrpg-1.0~rc2/lua/loadlib.c Examining data/freedroidrpg-1.0~rc2/lua/lobject.c Examining data/freedroidrpg-1.0~rc2/lua/lobject.h Examining data/freedroidrpg-1.0~rc2/lua/lopcodes.c Examining data/freedroidrpg-1.0~rc2/lua/lopcodes.h Examining data/freedroidrpg-1.0~rc2/lua/loslib.c Examining data/freedroidrpg-1.0~rc2/lua/lparser.c Examining data/freedroidrpg-1.0~rc2/lua/lparser.h Examining data/freedroidrpg-1.0~rc2/lua/lprefix.h Examining data/freedroidrpg-1.0~rc2/lua/lstate.c Examining data/freedroidrpg-1.0~rc2/lua/lstate.h Examining data/freedroidrpg-1.0~rc2/lua/lstring.c Examining data/freedroidrpg-1.0~rc2/lua/lstring.h Examining data/freedroidrpg-1.0~rc2/lua/lstrlib.c Examining data/freedroidrpg-1.0~rc2/lua/ltable.c Examining data/freedroidrpg-1.0~rc2/lua/ltable.h Examining data/freedroidrpg-1.0~rc2/lua/ltablib.c Examining data/freedroidrpg-1.0~rc2/lua/ltm.c Examining data/freedroidrpg-1.0~rc2/lua/ltm.h Examining data/freedroidrpg-1.0~rc2/lua/lua.c Examining data/freedroidrpg-1.0~rc2/lua/lua.h Examining data/freedroidrpg-1.0~rc2/lua/lua.hpp Examining data/freedroidrpg-1.0~rc2/lua/luac.c Examining data/freedroidrpg-1.0~rc2/lua/luaconf.h Examining data/freedroidrpg-1.0~rc2/lua/lualib.h Examining data/freedroidrpg-1.0~rc2/lua/lundump.c Examining data/freedroidrpg-1.0~rc2/lua/lundump.h Examining data/freedroidrpg-1.0~rc2/lua/lutf8lib.c Examining data/freedroidrpg-1.0~rc2/lua/lvm.c Examining data/freedroidrpg-1.0~rc2/lua/lvm.h Examining data/freedroidrpg-1.0~rc2/lua/lzio.c Examining data/freedroidrpg-1.0~rc2/lua/lzio.h Examining data/freedroidrpg-1.0~rc2/src/BFont.c Examining data/freedroidrpg-1.0~rc2/src/BFont.h Examining data/freedroidrpg-1.0~rc2/src/action.c Examining data/freedroidrpg-1.0~rc2/src/addon_crafting_ui.c Examining data/freedroidrpg-1.0~rc2/src/animate.c Examining data/freedroidrpg-1.0~rc2/src/armor.c Examining data/freedroidrpg-1.0~rc2/src/automap.c Examining data/freedroidrpg-1.0~rc2/src/benchmark.c Examining data/freedroidrpg-1.0~rc2/src/blocks.c Examining data/freedroidrpg-1.0~rc2/src/bullet.c Examining data/freedroidrpg-1.0~rc2/src/character.c Examining data/freedroidrpg-1.0~rc2/src/chat.c Examining data/freedroidrpg-1.0~rc2/src/colldet.c Examining data/freedroidrpg-1.0~rc2/src/defs.h Examining data/freedroidrpg-1.0~rc2/src/dynarray.c Examining data/freedroidrpg-1.0~rc2/src/enemy.c Examining data/freedroidrpg-1.0~rc2/src/event.c Examining data/freedroidrpg-1.0~rc2/src/extint_macros.h Examining data/freedroidrpg-1.0~rc2/src/faction.c Examining data/freedroidrpg-1.0~rc2/src/floor_tiles.c Examining data/freedroidrpg-1.0~rc2/src/font.c Examining data/freedroidrpg-1.0~rc2/src/game_act.c Examining data/freedroidrpg-1.0~rc2/src/game_ui.c Examining data/freedroidrpg-1.0~rc2/src/getopt.c Examining data/freedroidrpg-1.0~rc2/src/getopt.h Examining data/freedroidrpg-1.0~rc2/src/getopt1.c Examining data/freedroidrpg-1.0~rc2/src/global.h Examining data/freedroidrpg-1.0~rc2/src/hud.c Examining data/freedroidrpg-1.0~rc2/src/image.c Examining data/freedroidrpg-1.0~rc2/src/influ.c Examining data/freedroidrpg-1.0~rc2/src/item_upgrades.c Examining data/freedroidrpg-1.0~rc2/src/item_upgrades_ui.c Examining data/freedroidrpg-1.0~rc2/src/items.c Examining data/freedroidrpg-1.0~rc2/src/keyboard.c Examining data/freedroidrpg-1.0~rc2/src/lang.c Examining data/freedroidrpg-1.0~rc2/src/lang.h Examining data/freedroidrpg-1.0~rc2/src/light.c Examining data/freedroidrpg-1.0~rc2/src/lists.c Examining data/freedroidrpg-1.0~rc2/src/lists.h Examining data/freedroidrpg-1.0~rc2/src/lua.c Examining data/freedroidrpg-1.0~rc2/src/lua/luaFD.c Examining data/freedroidrpg-1.0~rc2/src/lua/luaFD.h Examining data/freedroidrpg-1.0~rc2/src/lua/luaFD_bindings.h Examining data/freedroidrpg-1.0~rc2/src/lua/luaFD_npc.c Examining data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c Examining data/freedroidrpg-1.0~rc2/src/luaconfig.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_actions.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_actions.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_beautify_actions.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_beautify_actions.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_display.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_display.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_input.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_map.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_map.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_object_lists.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_object_lists.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_move.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_move.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_place.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_place.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_select.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_select.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tools.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tools.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_categoryselect.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_categoryselect.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_map.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_map.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_minimap.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_minimap.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.h Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widgets.c Examining data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widgets.h Examining data/freedroidrpg-1.0~rc2/src/map.c Examining data/freedroidrpg-1.0~rc2/src/map.h Examining data/freedroidrpg-1.0~rc2/src/map_label.c Examining data/freedroidrpg-1.0~rc2/src/mapgen/gram_simple.c Examining data/freedroidrpg-1.0~rc2/src/mapgen/mapgen.c Examining data/freedroidrpg-1.0~rc2/src/mapgen/mapgen.h Examining data/freedroidrpg-1.0~rc2/src/mapgen/themes.c Examining data/freedroidrpg-1.0~rc2/src/mapgen/themes.h Examining data/freedroidrpg-1.0~rc2/src/menu.c Examining data/freedroidrpg-1.0~rc2/src/mission.c Examining data/freedroidrpg-1.0~rc2/src/npc.c Examining data/freedroidrpg-1.0~rc2/src/obstacle.c Examining data/freedroidrpg-1.0~rc2/src/obstacle_extension.c Examining data/freedroidrpg-1.0~rc2/src/open_gl.c Examining data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c Examining data/freedroidrpg-1.0~rc2/src/open_gl_debug.c Examining data/freedroidrpg-1.0~rc2/src/open_gl_shaders.c Examining data/freedroidrpg-1.0~rc2/src/pathfinder.c Examining data/freedroidrpg-1.0~rc2/src/pngfuncs.c Examining data/freedroidrpg-1.0~rc2/src/pngfuncs.h Examining data/freedroidrpg-1.0~rc2/src/proto.h Examining data/freedroidrpg-1.0~rc2/src/quest_browser_ui.c Examining data/freedroidrpg-1.0~rc2/src/rtprof.c Examining data/freedroidrpg-1.0~rc2/src/rtprof.h Examining data/freedroidrpg-1.0~rc2/src/savegame/convert.c Examining data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16.c Examining data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c Examining data/freedroidrpg-1.0~rc2/src/savegame/savegame.h Examining data/freedroidrpg-1.0~rc2/src/saveloadgame.c Examining data/freedroidrpg-1.0~rc2/src/savestruct_internal.h Examining data/freedroidrpg-1.0~rc2/src/scandir.c Examining data/freedroidrpg-1.0~rc2/src/scandir.h Examining data/freedroidrpg-1.0~rc2/src/shop.c Examining data/freedroidrpg-1.0~rc2/src/skills.c Examining data/freedroidrpg-1.0~rc2/src/sound.c Examining data/freedroidrpg-1.0~rc2/src/sound_effects.c Examining data/freedroidrpg-1.0~rc2/src/string.c Examining data/freedroidrpg-1.0~rc2/src/struct.h Examining data/freedroidrpg-1.0~rc2/src/system.h Examining data/freedroidrpg-1.0~rc2/src/takeover.c Examining data/freedroidrpg-1.0~rc2/src/takeover.h Examining data/freedroidrpg-1.0~rc2/src/text_public.c Examining data/freedroidrpg-1.0~rc2/src/title.c Examining data/freedroidrpg-1.0~rc2/src/vars.h Examining data/freedroidrpg-1.0~rc2/src/view.c Examining data/freedroidrpg-1.0~rc2/src/waypoint.c Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_autoscroll_text.c Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_autoscroll_text.h Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_background.c Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_background.h Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_button.c Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_button.h Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_group.c Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_group.h Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_text.c Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_text.h Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_text_list.c Examining data/freedroidrpg-1.0~rc2/src/widgets/widget_text_list.h Examining data/freedroidrpg-1.0~rc2/src/widgets/widgets.c Examining data/freedroidrpg-1.0~rc2/src/widgets/widgets.h Examining data/freedroidrpg-1.0~rc2/src/input.c Examining data/freedroidrpg-1.0~rc2/src/text.c Examining data/freedroidrpg-1.0~rc2/src/graphics.c Examining data/freedroidrpg-1.0~rc2/src/init.c Examining data/freedroidrpg-1.0~rc2/src/main.c Examining data/freedroidrpg-1.0~rc2/src/misc.c Examining data/freedroidrpg-1.0~rc2/src/savestruct_internal.c Examining data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c Examining data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c Examining data/freedroidrpg-1.0~rc2/tools/fddnm/dialog_dot.cpp Examining data/freedroidrpg-1.0~rc2/tools/fddnm/dialog_dot.h Examining data/freedroidrpg-1.0~rc2/tools/fddnm/dialog_dot_struct.h Examining data/freedroidrpg-1.0~rc2/tools/fddnm/dialog_file.cpp Examining data/freedroidrpg-1.0~rc2/tools/fddnm/dialog_file.h Examining data/freedroidrpg-1.0~rc2/tools/fddnm/dialog_node.cpp Examining data/freedroidrpg-1.0~rc2/tools/fddnm/dialog_node.h Examining data/freedroidrpg-1.0~rc2/tools/fddnm/dialog_regex.h Examining data/freedroidrpg-1.0~rc2/tools/fddnm/fddnm.cpp Examining data/freedroidrpg-1.0~rc2/tools/fddnm/fddnm.h Examining data/freedroidrpg-1.0~rc2/tools/fddnm/fddnm_dot_data.h Examining data/freedroidrpg-1.0~rc2/tools/fddnm/main.cpp Examining data/freedroidrpg-1.0~rc2/tools/font/codeset.c Examining data/freedroidrpg-1.0~rc2/tools/font/codeset.h Examining data/freedroidrpg-1.0~rc2/tools/font/explodefont.c Examining data/freedroidrpg-1.0~rc2/tools/font/gluefont.c Examining data/freedroidrpg-1.0~rc2/tools/font/make_bmchars.c Examining data/freedroidrpg-1.0~rc2/tools/image/croppy.c FINAL RESULTS: data/freedroidrpg-1.0~rc2/lua/lauxlib.h:226:10: [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. (fprintf(stderr, (s), (p)), fflush(stderr)) data/freedroidrpg-1.0~rc2/lua/liolib.c:52:40: [4] (shell) popen: 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. #define l_popen(L,c,m) (fflush(NULL), popen(c,m)) data/freedroidrpg-1.0~rc2/lua/liolib.c:605:19: [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. ? fprintf(f, LUA_INTEGER_FMT, lua_tointeger(L, arg)) data/freedroidrpg-1.0~rc2/lua/liolib.c:606:19: [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. : fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)); data/freedroidrpg-1.0~rc2/lua/loslib.c:106: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(b, LUA_TMPNAMTEMPLATE); \ data/freedroidrpg-1.0~rc2/lua/loslib.c:127:14: [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. int stat = system(cmd); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:835:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. return sprintf(buff, LUA_NUMBER_FMT, x); /* equal to '%g' */ data/freedroidrpg-1.0~rc2/lua/lstrlib.c:837:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buff, LUA_NUMBER_FMT, x); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:950:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(form + l - 1, lenmod); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:978:16: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. nb = sprintf(buff, form, (int)luaL_checkinteger(L, arg)); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:985:16: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. nb = sprintf(buff, form, n); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:995:16: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. nb = sprintf(buff, form, luaL_checknumber(L, arg)); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:1011:18: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. nb = sprintf(buff, form, s); data/freedroidrpg-1.0~rc2/lua/luac.c:263:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(bvalue(o) ? "true" : "false"); data/freedroidrpg-1.0~rc2/lua/luac.c:268:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buff,LUA_NUMBER_FMT,fltvalue(o)); data/freedroidrpg-1.0~rc2/lua/luac.c:274:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(LUA_INTEGER_FMT,ivalue(o)); data/freedroidrpg-1.0~rc2/lua/luaconf.h:473:29: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) data/freedroidrpg-1.0~rc2/lua/luaconf.h:509:30: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define lua_integer2str(s,n) sprintf((s), LUA_INTEGER_FMT, (n)) data/freedroidrpg-1.0~rc2/lua/luaconf.h:598:34: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define lua_number2strx(L,b,f,n) sprintf(b,f,n) data/freedroidrpg-1.0~rc2/src/addon_crafting_ui.c:336:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( text ,"%s%02d", font_switchto_neon, ui.materials_for_selected[i].required); data/freedroidrpg-1.0~rc2/src/addon_crafting_ui.c:352:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( text ,"%s%02d", font_switchto_red, ui.materials_for_selected[i].available); data/freedroidrpg-1.0~rc2/src/addon_crafting_ui.c:355:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( text ,"%s--", font_switchto_neon); data/freedroidrpg-1.0~rc2/src/addon_crafting_ui.c:357:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( text ,"%s%02d", font_switchto_neon, ui.materials_for_selected[i].available); data/freedroidrpg-1.0~rc2/src/benchmark.c:313:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "Testing \"%s\"...", do_benchmark); data/freedroidrpg-1.0~rc2/src/blocks.c:61:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(filename, animations[i].format_string, &rotation_index, &phase_index) == 2) { data/freedroidrpg-1.0~rc2/src/blocks.c:122:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(atlas_filename, "%s/atlas.txt", droid_spec->gfx_prefix); data/freedroidrpg-1.0~rc2/src/blocks.c:123:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(atlas_directory, "%s/", droid_spec->gfx_prefix); data/freedroidrpg-1.0~rc2/src/blocks.c:179:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fpath, "blasts/%s_%04d.png", Blastmap[i].name, j + 1); data/freedroidrpg-1.0~rc2/src/blocks.c:191:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(image_filename, "items/%s", spec->item_inv_file_name); data/freedroidrpg-1.0~rc2/src/blocks.c:248:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(image_filename, "items/%s/ingame.png", spec->item_rotation_series_prefix); data/freedroidrpg-1.0~rc2/src/blocks.c:350:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(constructed_filename, "bullets/iso_bullet_%s_%02d_%04d.png", bullet_spec->name, k, j + 1); data/freedroidrpg-1.0~rc2/src/blocks.c:372:2: [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(offset_file_name, fpath); data/freedroidrpg-1.0~rc2/src/blocks.c:441:2: [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(fpath, Droidmap[type].gfx_prefix); data/freedroidrpg-1.0~rc2/src/getopt.c:637:5: [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. fprintf(stderr, ("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); data/freedroidrpg-1.0~rc2/src/getopt.c:656:8: [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. fprintf(stderr, data/freedroidrpg-1.0~rc2/src/getopt.c:660:8: [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. fprintf(stderr, data/freedroidrpg-1.0~rc2/src/getopt.c:675:7: [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. fprintf(stderr, ("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); data/freedroidrpg-1.0~rc2/src/getopt.c:699:6: [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. fprintf(stderr, ("%s: unrecognized option `--%s'\n"), argv[0], nextchar); data/freedroidrpg-1.0~rc2/src/getopt.c:702:6: [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. fprintf(stderr, ("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); data/freedroidrpg-1.0~rc2/src/getopt.c:725:6: [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. fprintf(stderr, ("%s: illegal option -- %c\n"), argv[0], c); data/freedroidrpg-1.0~rc2/src/getopt.c:727:6: [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. fprintf(stderr, ("%s: invalid option -- %c\n"), argv[0], c); data/freedroidrpg-1.0~rc2/src/getopt.c:751:6: [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. fprintf(stderr, ("%s: option requires an argument -- %c\n"), argv[0], c); data/freedroidrpg-1.0~rc2/src/getopt.c:790:6: [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. fprintf(stderr, ("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); data/freedroidrpg-1.0~rc2/src/getopt.c:804:8: [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. fprintf(stderr, ("\ data/freedroidrpg-1.0~rc2/src/getopt.c:815:8: [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. fprintf(stderr, data/freedroidrpg-1.0~rc2/src/getopt.c:852:7: [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. fprintf(stderr, ("%s: option requires an argument -- %c\n"), argv[0], c); data/freedroidrpg-1.0~rc2/src/graphics.c:799:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(window_title_string, "FreedroidRPG %s", VERSION); data/freedroidrpg-1.0~rc2/src/hud.c:462:2: [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(buffer, text); data/freedroidrpg-1.0~rc2/src/hud.c:649:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(level_name_and_time, "%s (%03.1f:%03.1f:%d) ", data/freedroidrpg-1.0~rc2/src/hud.c:655:4: [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(level_name_and_time, temp_text); data/freedroidrpg-1.0~rc2/src/hud.c:658:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(level_name_and_time, "%s ", D_(curShip.AllLevels[Me.pos.z]->Levelname)); data/freedroidrpg-1.0~rc2/src/hud.c:662:4: [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(level_name_and_time, temp_text); data/freedroidrpg-1.0~rc2/src/init.c:832:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(data_dirs[CONFIG_DIR].path, "%s/FreedroidRPG", mydocuments_path); data/freedroidrpg-1.0~rc2/src/keyboard.c:259:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(out, "%s%s%s%s", ctrl_modstr, alt_modstr, shift_modstr, SDL_GetKeyName(kb->key)); data/freedroidrpg-1.0~rc2/src/keyboard.c:299:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(txt, "%s%s%s: %s", font_str, (i == cursor) ? "> " : " ", data/freedroidrpg-1.0~rc2/src/keyboard.c:767:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(relative_filename, "%s.screenshot-%d.png", Me.character_name, SDL_GetTicks()/1000); data/freedroidrpg-1.0~rc2/src/lua.c:360:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg, _("Received item: %s (on floor)"), itemname); data/freedroidrpg-1.0~rc2/src/lua.c:362:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg, _("Received item: %s"), itemname); data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c:707:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg, _("Received Item: %s (on floor)"), item_name); data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c:709:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg, _("Received Item: %s"), item_name); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_display.c:92:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(panel_text, _("\n Map label information: \n label_name=\"%s\"."), m->label_name); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:174:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(suggested_val, "%s", get_faction_from_id(en->faction)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:184:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(suggested_val, "%s", en->dialog_section_name); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:199:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(suggested_val, "%s", user_input); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:207:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(suggested_val, "%s", en->short_description_text); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:219:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(suggested_val, "%s", en->CompletelyFixed ? _("no") : _("yes")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:263:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(suggested_val, "%s", (en->on_death_drop_item_code == -1) ? _("none") : ItemMap[en->on_death_drop_item_code].id); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:282:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(suggested_val, "%s", user_input); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:289:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(suggested_val, "%s", en->will_rush_tux ? _("yes") : _("no")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:493:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(options[i], _("Level name (untranslated): %s"), EditLevel()->Levelname); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:536:4: [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(options[i], Droidmap[droid_types[j]].droidname); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:541:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(options[i], "%s: %s", _("Respawn"), data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:551:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(options[i], _("Item drop class for obstacles: %s. (<-/->)"), class); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:555:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(options[i], "%s: %s", _("Teleport blockade"), data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:560:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(options[i], "%s: %s", _("Teleport pair"), data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:940:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(options[i], _("Game act (untranslated): %s"), game_act_get_current()->name); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:943:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(options[i], _("Level name (untranslated): %d - %s"), EditLevel()->levelnum, EditLevel()->Levelname); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:178:2: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(validator_error->format, args); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:115:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, _("Obs. number %d, %s\n"), obs_idx, ((char **)get_obstacle_spec(obs_idx)->filenames.arr)[0]); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:133:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, _("%s\n\ data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:147:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, _("%s (%s)\n\ data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:158:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, _("%s (%s)\n\ data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:168:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, _("%s (%s)\n\ data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:177:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "%s (%s)\n%s", data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:189:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, _("Overlay floor tile number %d, filename %s\n"), index, ((char **)floor_tile->filenames.arr)[0]); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:192:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, _("Underlay floor tile number %d, filename %s\n"), array[idx], ((char **)floor_tile->filenames.arr)[0]); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:199:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, _("Waypoint %s connection, %sused for random spawn\n"), _("two way"), array[idx] ? _("not ") : ""); data/freedroidrpg-1.0~rc2/src/map.c:563:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(type_string, "%s%d=", ITEM_SOCKET_TYPE_STRING, i); data/freedroidrpg-1.0~rc2/src/map.c:564:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(addon_string, "%s%d=", ITEM_SOCKET_ADDON_STRING, i); data/freedroidrpg-1.0~rc2/src/menu.c:1008:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(MenuTexts[0], _("Difficulty: %s"), _(difficulty_str[GameConfig.difficulty_level])); data/freedroidrpg-1.0~rc2/src/menu.c:1322:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(Options[i], _("Fullscreen mode: %s"), GameConfig.fullscreen_on ? _("ON") : _("OFF")); data/freedroidrpg-1.0~rc2/src/menu.c:1326:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(Options[i], _("Show blood: %s"), GameConfig.show_blood ? _("YES") : _("NO")); data/freedroidrpg-1.0~rc2/src/menu.c:1511:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(Options[i], _("Show light radius: %s"), GameConfig.skip_light_radius ? _("NO") : _("YES")); data/freedroidrpg-1.0~rc2/src/menu.c:1514:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(Options[i], _("Show obstacle shadows: %s"), GameConfig.skip_shadow_blitting ? _("NO") : _("YES")); data/freedroidrpg-1.0~rc2/src/menu.c:1519:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(MenuTexts[i], _("Precache item graphics: %s"), GameConfig.lazyload ? _("NO") : _("YES")); data/freedroidrpg-1.0~rc2/src/menu.c:1588:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(MenuTexts[i++], _("Show position: %s"), GameConfig.Draw_Position ? _("YES") : _("NO")); data/freedroidrpg-1.0~rc2/src/menu.c:1589:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(MenuTexts[i++], _("Show framerate: %s"), GameConfig.Draw_Framerate ? _("YES") : _("NO")); data/freedroidrpg-1.0~rc2/src/menu.c:1590:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(MenuTexts[i++], _("Show enemies' energy bars: %s"), GameConfig.enemy_energy_bars_visible ? _("YES") : _("NO")); data/freedroidrpg-1.0~rc2/src/menu.c:1591:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(MenuTexts[i++], _("Show effect countdowns: %s"), GameConfig.effect_countdowns_visible ? _("YES") : _("NO")); data/freedroidrpg-1.0~rc2/src/menu.c:1809:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(SafetyText, _("Really delete hero '%s'?"), Me.character_name); data/freedroidrpg-1.0~rc2/src/misc.c:642:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(file_path, "%s/" WELL_KNOWN_DATA_FILE, top_data_dir[i]); data/freedroidrpg-1.0~rc2/src/misc.c:726: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. int rtn = access(dir_path, F_OK); data/freedroidrpg-1.0~rc2/src/misc.c:741: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. rtn = access(dir_path, W_OK); data/freedroidrpg-1.0~rc2/src/misc.c:778:19: [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. int access_rtn = access(fpath, R_OK); data/freedroidrpg-1.0~rc2/src/misc.c:1552:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s %s", OPENTXT_CMD, outfn); data/freedroidrpg-1.0~rc2/src/misc.c:1553:10: [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. rtn = system(cmd); data/freedroidrpg-1.0~rc2/src/open_gl.c:647:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "backgrounds/%s", bg->filename); data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c:66:2: [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(atlas_path, directory); data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c:80:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(&atlas_path[directory_len], filename); data/freedroidrpg-1.0~rc2/src/proto.h:33:68: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define PRINTF_FMT_ATTRIBUTE(fmt,firstarg) __attribute__ ((format(printf,fmt,firstarg))) data/freedroidrpg-1.0~rc2/src/rtprof.c:291:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(text, "%s%s", font_switchto_msgstat, title); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16.c:110:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(new_savegame, "--[[\n%s", version_string->value); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:122:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s%s", core_filename, SAVE_GAME_THUMBNAIL_EXT); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:136:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(last_filename, core_filename); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:165:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s%s", core_filename, SAVEDGAME_EXT); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:190:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s%s", core_filename, ".shp"); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:206:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s%s", core_filename, SAVE_GAME_THUMBNAIL_EXT); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:215:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(last_filename, core_filename); data/freedroidrpg-1.0~rc2/src/shop.c:239:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ConstructedFileName, "items/%s/portrait_%04d.jpg", ItemMap[Number].item_rotation_series_prefix, i + 1); data/freedroidrpg-1.0~rc2/src/shop.c:256:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(LastImageSeriesPrefix, ItemMap[Number].item_rotation_series_prefix); data/freedroidrpg-1.0~rc2/src/skills.c:706:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "skill_icons/%s", spec->icon_name); data/freedroidrpg-1.0~rc2/src/sound_effects.c:148:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sample_path, "%s/%d.ogg", path, MyRandom(last - first) + first); data/freedroidrpg-1.0~rc2/src/sound_effects.c:171:2: [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(final_file_name, ItemMap[item_type].item_drop_sound_file_name); data/freedroidrpg-1.0~rc2/src/sound_effects.c:324:2: [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(sound_file, bullet_spec->sound); data/freedroidrpg-1.0~rc2/src/sound_effects.c:362:2: [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(fpath, blast_sound); data/freedroidrpg-1.0~rc2/src/string.c:124:7: [4] (format) vsnprintf: 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. nr = vsnprintf(str->value + offset, size, fmt, tmp_args); data/freedroidrpg-1.0~rc2/src/takeover.c:170:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/portrait_%04d.jpg", Droidmap[type].gfx_prefix, i + 1); data/freedroidrpg-1.0~rc2/src/text.c:297:2: [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(Me.BigScreenMessage[0], ScreenMessageText); data/freedroidrpg-1.0~rc2/src/text.c:340:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(text, "%s", message); data/freedroidrpg-1.0~rc2/src/text.c:342:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(text, "%s %dm%ds", message, minutes, seconds); data/freedroidrpg-1.0~rc2/src/text.c:344:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(text, "%s %.1fs", message, duration); data/freedroidrpg-1.0~rc2/src/text.c:785:2: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(tmp, fmt, args); data/freedroidrpg-1.0~rc2/src/text_public.c:109:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/freedroidrpg-1.0~rc2/src/text_public.c:214:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/freedroidrpg-1.0~rc2/src/text_public.c:611:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(SourceLocation, FormatString, TargetValue) == EOF) { data/freedroidrpg-1.0~rc2/src/text_public.c:646:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(SourceLocation, FormatString, TargetValue) == EOF) { data/freedroidrpg-1.0~rc2/src/view.c:2014:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(tux_images[motion_class].part_names[tux_part_group], part_string); data/freedroidrpg-1.0~rc2/src/view.c:2339:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(txt, "%d - %s", e->id, e->TextToBeDisplayed); data/freedroidrpg-1.0~rc2/src/widgets/widget_background.c:169:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(file,"%s_%i_%i.png", base_name, i, j); data/freedroidrpg-1.0~rc2/src/widgets/widgets.c:247:2: [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(buffer, tooltip_text); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:10:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fpath, "%s.offset", basename); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:36:2: [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(basename, fpath); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:49:2: [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(element_filename, output_directory); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:127:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(atlas_directory, "%s/", argv[2]); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:129:2: [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(atlas_path, atlas_directory); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:136:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(output_directory, "%s/", argv[3]); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:97:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "./%s%d.png", image_out_path + img_dir_len + 1, atlas_num); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:99:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s%d.png", image_out_path, atlas_num); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:102:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s%d.png", image_out_path, atlas_num); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:112:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s%d.png", image_out_path, atlas_num); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:244:3: [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(offset_file_name, img_dir); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:247:2: [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(offset_file_name, img->f); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:296:4: [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(fn, img_dir); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:301:3: [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(fn, images[i].f); data/freedroidrpg-1.0~rc2/tools/font/codeset.c:526:3: [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(str, codeset_specs[i].name); data/freedroidrpg-1.0~rc2/tools/font/codeset.c:653:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(font_char_name, "%s/%s-%s.png", font_path, font_base, cs_code_to_name(code, codeset)); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:165:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stdout, fmt, args); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:593:2: [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, input_filename); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:620:3: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. sscanf(offset_x_string, OFFSET_FILE_OFFSETX_STRING "%d", &offset_x); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:622:3: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. sscanf(offset_y_string, OFFSET_FILE_OFFSETY_STRING "%d", &offset_y); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:653:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s", output_filename); data/freedroidrpg-1.0~rc2/lua/lmathlib.c:28:18: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define l_rand() random() data/freedroidrpg-1.0~rc2/lua/lmathlib.c:29:20: [3] (random) srandom: 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. #define l_srand(x) srandom(x) data/freedroidrpg-1.0~rc2/lua/lmathlib.c:33:20: [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. #define l_srand(x) srand(x) data/freedroidrpg-1.0~rc2/lua/loadlib.c:687:22: [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. const char *path = getenv(envname1); data/freedroidrpg-1.0~rc2/lua/loadlib.c:689:12: [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. path = getenv(envname2); /* try alternative name */ data/freedroidrpg-1.0~rc2/lua/loslib.c:115:33: [3] (tmpfile) tmpnam: Temporary file race condition (CWE-377). #define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } data/freedroidrpg-1.0~rc2/lua/loslib.c:162:21: [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. lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ data/freedroidrpg-1.0~rc2/lua/lua.c:538:22: [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. const char *init = getenv(name + 1); data/freedroidrpg-1.0~rc2/lua/lua.c:541:12: [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. init = getenv(name + 1); /* try alternative name */ data/freedroidrpg-1.0~rc2/src/getopt.c:213:9: [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. #ifndef getenv data/freedroidrpg-1.0~rc2/src/getopt.c:214:14: [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. extern char *getenv(); data/freedroidrpg-1.0~rc2/src/getopt.c:392:20: [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. posixly_correct = getenv("POSIXLY_CORRECT"); data/freedroidrpg-1.0~rc2/src/getopt.c:870:5: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt(argc, argv, optstring) data/freedroidrpg-1.0~rc2/src/getopt.h:111:13: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt(int argc, char *const *argv, const char *shortopts); data/freedroidrpg-1.0~rc2/src/getopt.h:114:13: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt(); data/freedroidrpg-1.0~rc2/src/getopt.h:117:13: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long(int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); data/freedroidrpg-1.0~rc2/src/getopt.h:124:13: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt(); data/freedroidrpg-1.0~rc2/src/getopt.h:125:13: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long(); data/freedroidrpg-1.0~rc2/src/getopt1.c:67:5: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt_long(argc, argv, options, long_options, opt_index) data/freedroidrpg-1.0~rc2/src/init.c:419:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int c = getopt_long(argc, argv, "vel:onqsb:h?d::r:wft", long_options, NULL); data/freedroidrpg-1.0~rc2/src/init.c:816:15: [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 *term = getenv("TERM"); data/freedroidrpg-1.0~rc2/src/init.c:841:21: [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. if ((our_homedir = getenv("HOME")) == NULL) { data/freedroidrpg-1.0~rc2/src/init.c:987: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(NULL)); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:210:7: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long(argc, argv, "gqnvi:o:h?d::", long_options, NULL); data/freedroidrpg-1.0~rc2/lua/lapi.c:1271:33: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (upisopen(*up1)) (*up1)->u.open.touched = 1; data/freedroidrpg-1.0~rc2/lua/lauxlib.c:460: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(newbuff, B->b, B->n * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lauxlib.c:472: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(b, s, l * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lauxlib.c:576: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 buff[BUFSIZ]; /* area for reading file */ data/freedroidrpg-1.0~rc2/lua/lauxlib.c:653:12: [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). lf.f = fopen(filename, "r"); data/freedroidrpg-1.0~rc2/lua/lauxlib.h:145: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 initb[LUAL_BUFFERSIZE]; /* initial buffer */ data/freedroidrpg-1.0~rc2/lua/ldblib.c:382: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 buff[5]; data/freedroidrpg-1.0~rc2/lua/ldblib.c:404: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[250]; data/freedroidrpg-1.0~rc2/lua/ldebug.c:605: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 buff[LUA_IDSIZE]; data/freedroidrpg-1.0~rc2/lua/ldo.c:157:50: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). for (up = L->openupval; up != NULL; up = up->u.open.next) data/freedroidrpg-1.0~rc2/lua/lfunc.c:66:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). pp = &p->u.open.next; data/freedroidrpg-1.0~rc2/lua/lfunc.c:71:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). uv->u.open.next = *pp; /* link it to list of open upvalues */ data/freedroidrpg-1.0~rc2/lua/lfunc.c:72:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). uv->u.open.touched = 1; data/freedroidrpg-1.0~rc2/lua/lfunc.c:87:26: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). L->openupval = uv->u.open.next; /* remove from 'open' list */ data/freedroidrpg-1.0~rc2/lua/lfunc.h:42:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). } open; data/freedroidrpg-1.0~rc2/lua/lgc.c:318:59: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). for (uv = thread->openupval; uv != NULL; uv = uv->u.open.next) { data/freedroidrpg-1.0~rc2/lua/lgc.c:319:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (uv->u.open.touched) { data/freedroidrpg-1.0~rc2/lua/lgc.c:321:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). uv->u.open.touched = 0; data/freedroidrpg-1.0~rc2/lua/lgc.c:516:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). uv->u.open.touched = 1; /* can be marked in 'remarkupvals' */ data/freedroidrpg-1.0~rc2/lua/liolib.c:238: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). p->f = fopen(fname, mode); data/freedroidrpg-1.0~rc2/lua/liolib.c:250: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). p->f = fopen(filename, mode); data/freedroidrpg-1.0~rc2/lua/liolib.c:276:10: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). p->f = tmpfile(); data/freedroidrpg-1.0~rc2/lua/liolib.c:372: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 buff[MAXRN + 1]; /* +1 for ending '\0' */ data/freedroidrpg-1.0~rc2/lua/liolib.c:422: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 decp[2]; data/freedroidrpg-1.0~rc2/lua/llex.c:379: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 buff[UTF8BUFFSZ]; data/freedroidrpg-1.0~rc2/lua/loadlib.c:193: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 buff[MAX_PATH + 1]; data/freedroidrpg-1.0~rc2/lua/loadlib.c:209: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[128]; data/freedroidrpg-1.0~rc2/lua/loadlib.c:378:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(filename, "r"); /* try to open file */ data/freedroidrpg-1.0~rc2/lua/lobject.c:332: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 buff[MAXNUMBER2STR]; data/freedroidrpg-1.0~rc2/lua/lobject.c:395: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. char buff[4*sizeof(void *) + 8]; /* should be enough space for a '%p' */ data/freedroidrpg-1.0~rc2/lua/lobject.c:396:17: [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. int l = sprintf(buff, "%p", va_arg(argp, void *)); data/freedroidrpg-1.0~rc2/lua/lobject.c:401: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. char buff[UTF8BUFFSZ]; data/freedroidrpg-1.0~rc2/lua/lobject.c:442:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define addstr(a,b,l) ( memcpy(a,b,(l) * sizeof(char)), a += (l) ) data/freedroidrpg-1.0~rc2/lua/lobject.c:448:7: [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(out, source + 1, l * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lobject.c:456:7: [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(out, source + 1, l * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lobject.c:460:7: [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(out, source + 1 + l - bufflen, bufflen * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lobject.c:476: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(out, POS, (LL(POS) + 1) * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lopcodes.c:20:17: [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. LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = { data/freedroidrpg-1.0~rc2/lua/lopcodes.h:288:17: [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. LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ data/freedroidrpg-1.0~rc2/lua/loslib.c:107:13: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). e = mkstemp(b); \ data/freedroidrpg-1.0~rc2/lua/loslib.c:151: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 buff[LUA_TMPNAMBUFSIZE]; data/freedroidrpg-1.0~rc2/lua/loslib.c:264: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 cc[4]; data/freedroidrpg-1.0~rc2/lua/loslib.c:273: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. char buff[200]; /* should be big enough for any conversion result */ data/freedroidrpg-1.0~rc2/lua/lstate.c:79: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(buff + p, &t, sizeof(t)); p += sizeof(t); } data/freedroidrpg-1.0~rc2/lua/lstate.c:82: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 buff[4 * sizeof(size_t)]; data/freedroidrpg-1.0~rc2/lua/lstate.c:268: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(lua_getextraspace(L1), lua_getextraspace(g->mainthread), data/freedroidrpg-1.0~rc2/lua/lstring.c:132: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(getaddrstr(ts), str, l * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:131:7: [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(p, s, l * sizeof(char)); p += l; data/freedroidrpg-1.0~rc2/lua/lstrlib.c:133: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(p, sep, lsep * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:137: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(p, s, l * sizeof(char)); /* last copy (not followed by separator) */ data/freedroidrpg-1.0~rc2/lua/lstrlib.c:838:5: [2] (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). Risk is low because the source is a constant string. strcat(buff, "x0p+0"); /* reuses '0/-0' from 'sprintf'... */ data/freedroidrpg-1.0~rc2/lua/lstrlib.c:858:10: [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. n += sprintf(buff + n, "p%+d", e); /* add exponent */ data/freedroidrpg-1.0~rc2/lua/lstrlib.c:907: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 buff[10]; data/freedroidrpg-1.0~rc2/lua/lstrlib.c:909: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(buff, "\\%d", (int)uchar(*s)); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:911: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(buff, "\\%03d", (int)uchar(*s)); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:936: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(form, strfrmt, ((p - strfrmt) + 1) * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:970: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 form[MAX_FORMAT]; /* to store the format ('%...') */ data/freedroidrpg-1.0~rc2/lua/lstrlib.c:1079: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 buff[5 * sizeof(lua_Number)]; /* enough for any float type */ data/freedroidrpg-1.0~rc2/lua/ltm.c:29:17: [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. LUAI_DDEF const char *const luaT_typenames_[LUA_TOTALTAGS] = { data/freedroidrpg-1.0~rc2/lua/ltm.h:56:17: [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. LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; data/freedroidrpg-1.0~rc2/lua/lua.c:306: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[LUA_MAXINPUT]; data/freedroidrpg-1.0~rc2/lua/lua.h:454: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 short_src[LUA_IDSIZE]; /* (S) */ data/freedroidrpg-1.0~rc2/lua/luac.c:181:38: [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* D= (output==NULL) ? stdout : fopen(output,"wb"); data/freedroidrpg-1.0~rc2/lua/luac.c:267: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 buff[100]; data/freedroidrpg-1.0~rc2/lua/lundump.c:216: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 buff[sizeof(LUA_SIGNATURE) + sizeof(LUAC_DATA)]; /* larger than both */ data/freedroidrpg-1.0~rc2/lua/lvm.c:479: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(buffer+tl, svalue(top-i), l * sizeof(char)); data/freedroidrpg-1.0~rc2/lua/lzio.c:60: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(b, z->p, m); data/freedroidrpg-1.0~rc2/src/addon_crafting_ui.c:315: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 text[10]; data/freedroidrpg-1.0~rc2/src/benchmark.c:101: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 fp[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/benchmark.c:234: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 fp[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/benchmark.c:253: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 fp[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/benchmark.c:310: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 str[1024]; data/freedroidrpg-1.0~rc2/src/blocks.c:119: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 atlas_filename[4096]; data/freedroidrpg-1.0~rc2/src/blocks.c:120:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char atlas_directory[4096]; data/freedroidrpg-1.0~rc2/src/blocks.c:175: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/blocks.c:188: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 image_filename[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/blocks.c:251: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(&spec->ingame_image, &spec->inventory_image, sizeof(struct image)); data/freedroidrpg-1.0~rc2/src/blocks.c:310: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(&ItemMap[i].ingame_image, &empty_image, sizeof(struct image)); data/freedroidrpg-1.0~rc2/src/blocks.c:324: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 our_filename[2000] = ""; data/freedroidrpg-1.0~rc2/src/blocks.c:327:3: [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(our_filename, "cursors/mouse_move_cursor_%d.png", j); data/freedroidrpg-1.0~rc2/src/blocks.c:340: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 constructed_filename[5000]; data/freedroidrpg-1.0~rc2/src/blocks.c:365: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 offset_file_name[10000]; data/freedroidrpg-1.0~rc2/src/blocks.c:374:2: [2] (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). Risk is low because the source is a constant string. strcat(offset_file_name, ".offset"); data/freedroidrpg-1.0~rc2/src/blocks.c:378: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). if ((OffsetFile = fopen(offset_file_name, "rb")) == NULL) { data/freedroidrpg-1.0~rc2/src/blocks.c:439: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 fpath[1024]; data/freedroidrpg-1.0~rc2/src/blocks.c:442:2: [2] (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). Risk is low because the source is a constant string. strcat(fpath, "/portrait.png"); data/freedroidrpg-1.0~rc2/src/blocks.c:582: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(&graphics->shadows[j], &empty_image, sizeof(empty_image)); data/freedroidrpg-1.0~rc2/src/blocks.c:687: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 atlas_filename[4096]; data/freedroidrpg-1.0~rc2/src/blocks.c:688: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 atlas_directory[4096-9]; // '-9' == sizeof("atlas.txt") data/freedroidrpg-1.0~rc2/src/blocks.c:689: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 *part_group_strings[ALL_PART_GROUPS] = { data/freedroidrpg-1.0~rc2/src/character.c:415: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 CharText[1000]; data/freedroidrpg-1.0~rc2/src/character.c:446: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(CharText, "%d", Me.exp_level); data/freedroidrpg-1.0~rc2/src/character.c:452: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(CharText, "%u", Me.Experience); data/freedroidrpg-1.0~rc2/src/character.c:458: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(CharText, "%u", get_experience_required(Me.exp_level)); data/freedroidrpg-1.0~rc2/src/character.c:464: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(CharText, "%6u", Me.Gold); data/freedroidrpg-1.0~rc2/src/character.c:470: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(CharText, "%d", Me.strength); data/freedroidrpg-1.0~rc2/src/character.c:472:3: [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(CharText + strlen(CharText), " (%+d)", Me.strength - Me.base_strength); data/freedroidrpg-1.0~rc2/src/character.c:478: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(CharText, "%d", Me.dexterity); data/freedroidrpg-1.0~rc2/src/character.c:480:3: [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(CharText + strlen(CharText), " (%+d)", Me.dexterity - Me.base_dexterity); data/freedroidrpg-1.0~rc2/src/character.c:486: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(CharText, "%d", Me.physique); data/freedroidrpg-1.0~rc2/src/character.c:488:3: [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(CharText + strlen(CharText), " (%+d)", Me.physique - Me.base_physique); data/freedroidrpg-1.0~rc2/src/character.c:494:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(CharText, "%d", Me.cooling); data/freedroidrpg-1.0~rc2/src/character.c:496:3: [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(CharText + strlen(CharText), " (%+d)", Me.cooling - Me.base_cooling); data/freedroidrpg-1.0~rc2/src/character.c:503: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(CharText, "%d", Me.points_to_distribute); data/freedroidrpg-1.0~rc2/src/character.c:509: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(CharText, "%d/%d", (int)Me.energy, (int)Me.maxenergy); data/freedroidrpg-1.0~rc2/src/character.c:515: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(CharText, "%d/%d", (int)Me.temperature, (int)Me.max_temperature); data/freedroidrpg-1.0~rc2/src/character.c:521: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(CharText, "%d/%d", (int)Me.running_power, (int)Me.max_running_power); data/freedroidrpg-1.0~rc2/src/character.c:527: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(CharText, "%d%%", (int)Me.to_hit); data/freedroidrpg-1.0~rc2/src/character.c:536:3: [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(CharText, "%d-%d", (int)Me.base_damage, (int)Me.base_damage + (int)Me.damage_modifier); data/freedroidrpg-1.0~rc2/src/character.c:538:3: [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(CharText, "%d", (int)Me.base_damage); data/freedroidrpg-1.0~rc2/src/character.c:545: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(CharText, "%d", (int)Me.armor_class); data/freedroidrpg-1.0~rc2/src/chat.c:484: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 *image[3]; data/freedroidrpg-1.0~rc2/src/dynarray.c:68:2: [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(to->arr, from->arr, from->capacity * membersize); data/freedroidrpg-1.0~rc2/src/dynarray.c:116:2: [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(array->arr + membersize * index, data, membersize); data/freedroidrpg-1.0~rc2/src/dynarray.c:155:2: [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(to->arr + to->size * membersize, from->arr, from->size * membersize); data/freedroidrpg-1.0~rc2/src/enemy.c:2109: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(&ThisRobot->PrivatePathway[0], &wps[0], 5 * sizeof(pointf)); data/freedroidrpg-1.0~rc2/src/event.c:296: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/font.c:69: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/game_ui.c:328: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 text[5] = ""; data/freedroidrpg-1.0~rc2/src/game_ui.c:333:3: [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(text, "%d", i < 9 ? i + 1: 0); data/freedroidrpg-1.0~rc2/src/game_ui.c:494: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 *image[2][3]; data/freedroidrpg-1.0~rc2/src/graphics.c:58: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 constructed_filename[2000]; data/freedroidrpg-1.0~rc2/src/graphics.c:59:4: [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(constructed_filename, "cursors/mouse_cursor_%04d.png", i); data/freedroidrpg-1.0~rc2/src/graphics.c:798: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 window_title_string[200]; data/freedroidrpg-1.0~rc2/src/graphics.c:802: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/hud.c:461: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[strlen(text) + 1]; data/freedroidrpg-1.0~rc2/src/hud.c:646: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 level_name_and_time[1000]; data/freedroidrpg-1.0~rc2/src/hud.c:647:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char temp_text[1000]; data/freedroidrpg-1.0~rc2/src/hud.c:652:4: [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(temp_text, _("Day %d %02d:%02d"), data/freedroidrpg-1.0~rc2/src/hud.c:659:4: [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(temp_text, _("Day %d %02d:%02d"), data/freedroidrpg-1.0~rc2/src/image.c:82: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 str[1024]; data/freedroidrpg-1.0~rc2/src/image.c:317: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(&requested_color[0], &t->c[0], sizeof(requested_color)); data/freedroidrpg-1.0~rc2/src/image.c:648: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/image.c:720:2: [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(img, &empty, sizeof(struct image)); data/freedroidrpg-1.0~rc2/src/influ.c:1028: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 *menu_texts[100]; data/freedroidrpg-1.0~rc2/src/influ.c:1211: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(&new_bullet, bullet_parameters, sizeof(struct bullet)); data/freedroidrpg-1.0~rc2/src/init.c:158: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 percent[10]; data/freedroidrpg-1.0~rc2/src/init.c:159: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(percent, "%d%%", startup_percent); data/freedroidrpg-1.0~rc2/src/init.c:177: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/init.c:286: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/init.c:302:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/init.c:472:19: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). debug_level = atoi(optarg); data/freedroidrpg-1.0~rc2/src/init.c:495:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int width = atoi(x); data/freedroidrpg-1.0~rc2/src/init.c:496:19: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int height = atoi(y); data/freedroidrpg-1.0~rc2/src/init.c:505:32: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). GameConfig.screen_width = atoi(x); data/freedroidrpg-1.0~rc2/src/init.c:506:33: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). GameConfig.screen_height = atoi(y); data/freedroidrpg-1.0~rc2/src/init.c:509:28: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int resolution_code = atoi(optarg); data/freedroidrpg-1.0~rc2/src/init.c:588: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 fp[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/init.c:739: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 vid_driver[81]; data/freedroidrpg-1.0~rc2/src/init.c:830: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 mydocuments_path[MAX_PATH]; data/freedroidrpg-1.0~rc2/src/init.c:834:3: [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(data_dirs[CONFIG_DIR].path, "./FreedroidRPG"); data/freedroidrpg-1.0~rc2/src/init.c:878: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 filename[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/item_upgrades_ui.c:98: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. const char *fnames[IMAGE_MAX] = { data/freedroidrpg-1.0~rc2/src/item_upgrades_ui.c:202: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[64]; data/freedroidrpg-1.0~rc2/src/item_upgrades_ui.c:203:4: [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, "%d", costs[i]); data/freedroidrpg-1.0~rc2/src/item_upgrades_ui.c:259: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[512]; data/freedroidrpg-1.0~rc2/src/item_upgrades_ui.c:260: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, _("Circuits: %d"), Me.Gold); data/freedroidrpg-1.0~rc2/src/item_upgrades_ui.c:267: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, _("Cost: %d"), ui.cost); data/freedroidrpg-1.0~rc2/src/items.c:638:2: [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(DestItem, SourceItem, sizeof(item)); data/freedroidrpg-1.0~rc2/src/items.c:653: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(dest_item, source_item, sizeof(item)); data/freedroidrpg-1.0~rc2/src/keyboard.c:186:40: [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. GameConfig.input_keybinds[i].name = (char *)default_keybinds[i].name; data/freedroidrpg-1.0~rc2/src/keyboard.c:274: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 txt[1024]; data/freedroidrpg-1.0~rc2/src/keyboard.c:290: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 keystr[100] = ""; data/freedroidrpg-1.0~rc2/src/keyboard.c:587:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int number = atoi(GameConfig.input_keybinds[keynum].name + strlen("activate_program")); data/freedroidrpg-1.0~rc2/src/keyboard.c:607:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int number = atoi(GameConfig.input_keybinds[keynum].name + strlen("quick_inventory")); data/freedroidrpg-1.0~rc2/src/keyboard.c:714:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int number = atoi(GameConfig.input_keybinds[keynum].name + strlen("place_obstacle_kp")); data/freedroidrpg-1.0~rc2/src/keyboard.c:765: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 filename[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/keyboard.c:766: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 relative_filename[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/light.c:969: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 constructed_file_name[2000]; data/freedroidrpg-1.0~rc2/src/light.c:972:4: [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(constructed_file_name, "light_radius_chunks/iso_light_radius_darkness_%04d.png", i); data/freedroidrpg-1.0~rc2/src/lua.c:358: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 msg[1000]; data/freedroidrpg-1.0~rc2/src/lua.c:493: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 tmpstr[150]; data/freedroidrpg-1.0~rc2/src/lua.c:495: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(tmpstr, _("+%d experience points"), xp); data/freedroidrpg-1.0~rc2/src/lua.c:516: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 tmpstr[150]; data/freedroidrpg-1.0~rc2/src/lua.c:527:3: [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(tmpstr, _("Gained %d valuable circuits!"), nb); data/freedroidrpg-1.0~rc2/src/lua.c:529:3: [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(tmpstr, _("Lost %d valuable circuits!"), -nb); data/freedroidrpg-1.0~rc2/src/lua.c:1130: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/lua.c:1936: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 *src = fopen(&ar.source[1], "r"); data/freedroidrpg-1.0~rc2/src/lua.c:1948: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[256] = ""; data/freedroidrpg-1.0~rc2/src/lua.c:2026: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/lua.c:2068: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/lua.c:2102: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/lua/luaFD_npc.c:536: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c:303: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 tmpstr[150]; data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c:304: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(tmpstr, _("+%d Experience Points"), points); data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c:337: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 tmpstr[150]; data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c:339:3: [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(tmpstr, _("Gained %d valuable circuits!"), amount); data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c:341:3: [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(tmpstr, _("Lost %d valuable circuits!"), -amount); data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c:705: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 msg[1000]; data/freedroidrpg-1.0~rc2/src/lua/luaFD_tux.c:980: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/luaconfig.c:308:29: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). *((short *)data) = (short)atoi(default_value); data/freedroidrpg-1.0~rc2/src/luaconfig.c:311:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). *((int *)data) = atoi(default_value); data/freedroidrpg-1.0~rc2/src/luaconfig.c:325:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int int_value = atoi(default_value); data/freedroidrpg-1.0~rc2/src/luaconfig.c:371: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. free (*((char **)data_specs[i].data)); data/freedroidrpg-1.0~rc2/src/luaconfig.c:691: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 default_transparency[20]; data/freedroidrpg-1.0~rc2/src/luaconfig.c:692: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(default_transparency, "%d", TRANSPARENCY_FOR_WALLS); data/freedroidrpg-1.0~rc2/src/luaconfig.c:890: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(&floor_tile.images[i], &empty_image, sizeof(struct image)); data/freedroidrpg-1.0~rc2/src/luaconfig.c:1155:2: [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(ItemMap, item_specs.arr, sizeof(itemspec) * Number_Of_Item_Types); data/freedroidrpg-1.0~rc2/src/luaconfig.c:1281:2: [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(Droidmap, droid_specs.arr, sizeof(droidspec) * Number_Of_Droid_Types); data/freedroidrpg-1.0~rc2/src/luaconfig.c:1522:2: [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(SpellSkillMap, skill_specs.arr, sizeof(spell_skill_spec) * number_of_skills); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit.c:52: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 VanishingMessage[10000] = ""; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit.h:191: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 VanishingMessage[10000]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_actions.c:610: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 suggested_label[200]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_display.c:66: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 gps_text[200]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_display.c:76: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 fps_text[200]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_display.c:77: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(fps_text, _(" FPS=%d\n"), get_current_fps()); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_display.c:90: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 panel_text[5000] = ""; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_display.c:321: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 linebuf[1000]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_display.c:322:3: [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(linebuf, _(" Source waypoint selected : X=%d Y=%d. "), wpts[OriginWaypoint].x, wpts[OriginWaypoint].y); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c: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 suggested_val[200]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:157: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(suggested_val, "%d", en->marker); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:242: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(suggested_val, "%d", en->max_distance_to_home); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_enemy.c:256:3: [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(suggested_val, "%d", numb); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_map.c:255: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(&MapTile, &(EditLevel->map[i][EditLevel->xlen - 1]), sizeof(map_tile)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_map.c:258: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(&(EditLevel->map[i][0]), &MapTile, sizeof(map_tile)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_map.c:402: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 levels_fn[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_map.c:403: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 forces_fn[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:62:10: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). tgt = atoi(str); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:79: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 *menu_texts[20]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:80: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 options[20][1000]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:99:3: [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(options[i], _("North Edge: -/+ (<-/->)")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:103:3: [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(options[i], _("East Edge: -/+ (<-/->)")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:107:3: [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(options[i], _("South Edge: -/+ (<-/->)")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:111:3: [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(options[i], _("West Edge: -/+ (<-/->)")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:115:3: [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(options[i], _("Current level size in X: %d."), edit_level->xlen); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:118:3: [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(options[i], _("Current level size in Y: %d."), edit_level->ylen); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:239: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 *menu_texts[100]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:240: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 options[20][500]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:256:3: [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(options[i], _("Neighbor level North: %d. (<-/->)"), edit_level->jump_target_north); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:259:3: [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(options[i], _("Neighbor level East: %d. (<-/->)"), edit_level->jump_target_east); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:262:3: [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(options[i], _("Neighbor level South: %d. (<-/->)"), edit_level->jump_target_south); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:265:3: [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(options[i], _("Neighbor level West: %d. (<-/->)"), edit_level->jump_target_west); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:352: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 *menu_texts[100]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:457: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 *menu_texts[100]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:459: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 options[20][OPTLEN]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:460: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 class[16]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:490:3: [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(options[i], _("Level: %d. (<-/->)"), EditLevel()->levelnum); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:496:3: [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(options[i], _("Size: X %d Y %d"), EditLevel()->xlen, EditLevel()->ylen); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:499:3: [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(options[i], _("Floor layers: %d"), EditLevel()->floor_layers); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:502:3: [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(options[i], _("Edge Interface: ")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:505:4: [2] (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). Risk is low because the source is a constant string. strcat(options[i], _("none")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:508:5: [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(options[i] + strlen(options[i]), _(" N: %d"), EditLevel()->jump_target_north); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:510:5: [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(options[i] + strlen(options[i]), _(" E: %d"), EditLevel()->jump_target_east); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:512:5: [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(options[i] + strlen(options[i]), _(" S: %d"), EditLevel()->jump_target_south); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:514:5: [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(options[i] + strlen(options[i]), _(" W: %d"), EditLevel()->jump_target_west); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:521:4: [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(options[i], _("Random dungeon: 2 connections")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:523:4: [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(options[i], _("Random dungeon: 1 connection")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:525:4: [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(options[i], _("Random dungeon: no")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:531:3: [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(options[i], _("Random droids: %d Types: "), EditLevel()->random_droids.nr); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:535:5: [2] (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). Risk is low because the source is a constant string. strcat(options[i], ", "); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:582:3: [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(options[i], _("Infinite Running Stamina: ")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:584:4: [2] (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). Risk is low because the source is a constant string. strcat(options[i], _("yes")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:586:5: [2] (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). Risk is low because the source is a constant string. (strcat(options[i], _("no"))); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:712: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 popup_message[1000]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:713:4: [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(popup_message, _("\n Please enter new number of floor layers (valid values are between 1 and %d): \n\n"), MAX_FLOOR_LAYERS); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:909: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 *menu_texts[100]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:910: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 options[20][1000]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_select.c:401: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(w, &wpts[i], sizeof(waypoint)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_select.c:440: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(m, &labels[i], sizeof(map_label)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_select.c:1020: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(o, e->data, sizeof(obstacle)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_select.c:1028: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(t->tile, ((struct lvledit_map_tile *) (e->data))->tile, sizeof(map_tile)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_select.c:1037: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(it, e->data, sizeof(item)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_select.c:1043: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(w, e->data, sizeof(waypoint)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_tool_select.c:1049: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(m, e->data, sizeof(map_label)); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:304: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:1567: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[40]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:1568:4: [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(txt, "%03d: [w]empty", l); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:1581: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[40]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:1584:5: [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(txt, "[w]%03d: [r]fail", l); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:1587:5: [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(txt, "[w]%03d: [n]warn", l); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:1591:5: [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(txt, "[w]%03d: [w]pass", l); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_minimap.c:130: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 text[3]; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_minimap.c:131:4: [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(text, "%d", lvl_id); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:118:3: [2] (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). Risk is low because the source is a constant string. strcat(str, "- IS_HORIZONTAL\n"); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:120:3: [2] (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). Risk is low because the source is a constant string. strcat(str, "- IS_VERTICAL\n"); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:122:3: [2] (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). Risk is low because the source is a constant string. strcat(str, "- BLOCKS_VISION_TOO\n"); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:124:3: [2] (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). Risk is low because the source is a constant string. strcat(str, "- IS_SMASHABLE\n"); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:126:3: [2] (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). Risk is low because the source is a constant string. strcat(str, "- IS_WALKABLE\n"); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:128:3: [2] (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). Risk is low because the source is a constant string. strcat(str, "- IS_CLICKABLE\n"); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widget_toolbar.c:208:4: [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(str, _("There currently is only one type of map label")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widgets.c:255:3: [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(VanishingMessage, _("Zoom factor set to %f."), zf); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widgets.c:257:3: [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(VanishingMessage, _("Could not change zoom factor.")); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_widgets.c:655: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/map.c:218:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->levelnum = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:228:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->xlen = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:238:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->ylen = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:248:28: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->floor_layers = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:258:27: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->light_bonus = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:267:35: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->minimum_light_value = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:276:46: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->infinite_running_on_this_level = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:285:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->random_dungeon = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:295:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->teleport_pair = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:308:34: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->dungeon_generated = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:321:22: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->flags = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:334:27: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). loadlevel->drop_class = atoi(fp); data/freedroidrpg-1.0~rc2/src/map.c:388: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 type_indication_string[droid_type_length + 1]; data/freedroidrpg-1.0~rc2/src/map.c:459:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int type = atoi(curfield); data/freedroidrpg-1.0~rc2/src/map.c:560: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 type_string[32]; data/freedroidrpg-1.0~rc2/src/map.c:561: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 addon_string[32]; data/freedroidrpg-1.0~rc2/src/map.c:839: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(this_line, map_begin + curlinepos, nlpos); data/freedroidrpg-1.0~rc2/src/map.c:904: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(this_line, wp_begin + curlinepos, nlpos); data/freedroidrpg-1.0~rc2/src/map.c:1280:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ShipFile = fopen(filename, "rb"); data/freedroidrpg-1.0~rc2/src/map.c:1697: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). if ((ShipFile = fopen(filename, "wb")) == NULL) { data/freedroidrpg-1.0~rc2/src/map.c:1742:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((s_forces_file = fopen(filename, "wb")) == NULL) { data/freedroidrpg-1.0~rc2/src/map.c:1828: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/map.c:1889: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 type_indication_string[droid_type_length + 1]; data/freedroidrpg-1.0~rc2/src/mapgen/gram_simple.c:299:11: [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 seen[total_rooms]; data/freedroidrpg-1.0~rc2/src/mapgen/gram_simple.c:300:11: [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 connected_to_room_0[total_rooms]; data/freedroidrpg-1.0~rc2/src/mapgen/mapgen.c:494: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 tmp[500]; data/freedroidrpg-1.0~rc2/src/mapgen/mapgen.c:496: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(tmp, "%dtoX%d", target_level->levelnum, telnum); data/freedroidrpg-1.0~rc2/src/mapgen/mapgen.c:499: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(tmp, "%dfromX%d", target_level->levelnum, telnum); data/freedroidrpg-1.0~rc2/src/menu.c:834:71: [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. #define MENU(x, y) static int x##_handle (int); static void x##_fill (char *[MAX_MENU_ITEMS]); data/freedroidrpg-1.0~rc2/src/menu.c:842:20: [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. void (*FillText) (char *[MAX_MENU_ITEMS]); data/freedroidrpg-1.0~rc2/src/menu.c:858: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 *texts[MAX_MENU_ITEMS]; data/freedroidrpg-1.0~rc2/src/menu.c:964:26: [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 void Startup_fill(char *MenuTexts[MAX_MENU_ITEMS]) data/freedroidrpg-1.0~rc2/src/menu.c:1000:23: [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 void Game_fill(char *MenuTexts[MAX_MENU_ITEMS]) data/freedroidrpg-1.0~rc2/src/menu.c:1059:26: [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 void Options_fill(char *MenuTexts[MAX_MENU_ITEMS]) data/freedroidrpg-1.0~rc2/src/menu.c:1115:25: [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 void Escape_fill(char *MenuTexts[MAX_MENU_ITEMS]) data/freedroidrpg-1.0~rc2/src/menu.c:1167:27: [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 void Language_fill(char *MenuTexts[MAX_MENU_ITEMS]) data/freedroidrpg-1.0~rc2/src/menu.c:1240:29: [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 void Resolution_fill(char *MenuTexts[MAX_MENU_ITEMS]) data/freedroidrpg-1.0~rc2/src/menu.c:1264:4: [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(MenuTexts[j++], "%c %dx%d", flag, screen_resolutions[i].xres, screen_resolutions[i].yres); data/freedroidrpg-1.0~rc2/src/menu.c:1316:27: [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 void Graphics_fill(char *MenuTexts[MAX_MENU_ITEMS]) data/freedroidrpg-1.0~rc2/src/menu.c:1318: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 Options[20][1000]; data/freedroidrpg-1.0~rc2/src/menu.c:1320: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(MenuTexts[i++], _("Change screen resolution")); data/freedroidrpg-1.0~rc2/src/menu.c:1409:24: [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 void Sound_fill(char *MenuTexts[MAX_MENU_ITEMS]) data/freedroidrpg-1.0~rc2/src/menu.c:1411: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 Options[20][1000]; data/freedroidrpg-1.0~rc2/src/menu.c:1413: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(Options[i], _("<-- Background music volume: %1.2f -->"), GameConfig.Current_BG_Music_Volume); data/freedroidrpg-1.0~rc2/src/menu.c:1417: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(Options[i], _("<-- Sound effects volume: %1.2f -->"), GameConfig.Current_Sound_FX_Volume); data/freedroidrpg-1.0~rc2/src/menu.c:1423:3: [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(Options[i], _("<-- Output: Stereo -->")); data/freedroidrpg-1.0~rc2/src/menu.c:1427:3: [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(Options[i], _("<-- Output: 4.0 Surround -->")); data/freedroidrpg-1.0~rc2/src/menu.c:1431:3: [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(Options[i], _("<-- Output: 5.1 Surround -->")); data/freedroidrpg-1.0~rc2/src/menu.c:1435:3: [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(Options[i], _("<-- Output: Error -->")); data/freedroidrpg-1.0~rc2/src/menu.c:1503: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 Options[20][1000]; data/freedroidrpg-1.0~rc2/src/menu.c:1506:3: [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(Options[i], _("FPS limit: none")); data/freedroidrpg-1.0~rc2/src/menu.c:1508:3: [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(Options[i], _("FPS limit: %d"), GameConfig.framerate_limit); data/freedroidrpg-1.0~rc2/src/menu.c:1585:22: [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 void OSD_fill(char *MenuTexts[MAX_MENU_ITEMS]) data/freedroidrpg-1.0~rc2/src/menu.c:1592: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(MenuTexts[i++], _("<-- Max. screen messages: %d -->"), GameConfig.number_of_big_screen_messages); data/freedroidrpg-1.0~rc2/src/menu.c:1593: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(MenuTexts[i++], _("<-- Screen message lifetime: %3.1fs -->"), GameConfig.delay_for_big_screen_messages); data/freedroidrpg-1.0~rc2/src/menu.c:1709: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 *MenuTexts[MAX_MENU_ITEMS]; data/freedroidrpg-1.0~rc2/src/menu.c:1808: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 SafetyText[500]; data/freedroidrpg-1.0~rc2/src/menu.c:1851: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 *MenuTexts[MAX_MENU_ITEMS]; data/freedroidrpg-1.0~rc2/src/misc.c:630: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 file_path[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/misc.c:643:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(file_path, "r"); data/freedroidrpg-1.0~rc2/src/misc.c:713: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 dir_path[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/misc.c:834: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 suffixed_fname[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/misc.c:849: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(suffixed_fname, fname, pos); data/freedroidrpg-1.0~rc2/src/misc.c:850: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(suffixed_fname + pos, suffix, suffix_length); data/freedroidrpg-1.0~rc2/src/misc.c:851: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(suffixed_fname + pos + suffix_length, fname + pos, fname_length - pos + 1); data/freedroidrpg-1.0~rc2/src/misc.c:904: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 l10ndir[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/misc.c:939: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 encoded_dir[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/misc.c:1330: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 fname[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/misc.c:1338: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). if ((configfile = fopen(fname, "rb")) == NULL) { data/freedroidrpg-1.0~rc2/src/misc.c:1407: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 fname[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/misc.c:1426:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((config_file = fopen(fname, "wb")) == NULL) { data/freedroidrpg-1.0~rc2/src/misc.c:1547: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 outfn[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/mission.c:202: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/npc.c:79: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/obstacle_extension.c:76: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(&lvl->obstacle_list[i], &lvl->obstacle_list[array_end], sizeof(obstacle)); data/freedroidrpg-1.0~rc2/src/open_gl.c:169:11: [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 pBuf[nPitch + 1]; data/freedroidrpg-1.0~rc2/src/open_gl.c:174: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(pBuf, pSrc, nPitch); data/freedroidrpg-1.0~rc2/src/open_gl.c:175: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(pSrc, pDst, nPitch); data/freedroidrpg-1.0~rc2/src/open_gl.c:176: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(pDst, pBuf, nPitch); data/freedroidrpg-1.0~rc2/src/open_gl.c:646: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 path[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c:46: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c:60: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 atlas_path[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c:75: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 filename[1024]; data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c:93: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 element_key[1024]; data/freedroidrpg-1.0~rc2/src/open_gl_shaders.c:174: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 errlog[4096]; data/freedroidrpg-1.0~rc2/src/open_gl_shaders.c:194: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 errlog[4096]; data/freedroidrpg-1.0~rc2/src/pngfuncs.c:88:7: [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/freedroidrpg-1.0~rc2/src/quest_browser_ui.c:43: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 stats_display[NB_DROID_TYPES]; data/freedroidrpg-1.0~rc2/src/quest_browser_ui.c:635: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 *image[3]; data/freedroidrpg-1.0~rc2/src/rtprof.c:290: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 text[200]; data/freedroidrpg-1.0~rc2/src/rtprof.c:330: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 text[16]; data/freedroidrpg-1.0~rc2/src/rtprof.c:331: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(text, "%g", (float)val / divider); data/freedroidrpg-1.0~rc2/src/rtprof.c:391: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 text[16]; data/freedroidrpg-1.0~rc2/src/rtprof.c:392: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(text, "%g", (float)min_val / divider); data/freedroidrpg-1.0~rc2/src/rtprof.c:395: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(text, "%g", (float)mean_val / divider); data/freedroidrpg-1.0~rc2/src/rtprof.c:398: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(text, "%g", (float)max_val / divider); data/freedroidrpg-1.0~rc2/src/rtprof.c:458: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 text[16]; data/freedroidrpg-1.0~rc2/src/rtprof.c:459: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(text, "%g", (float)min_val / divider); data/freedroidrpg-1.0~rc2/src/rtprof.c:462: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(text, "%g", (float)mean_val / divider); data/freedroidrpg-1.0~rc2/src/rtprof.c:465: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(text, "%g", (float)max_val / divider); data/freedroidrpg-1.0~rc2/src/savegame/convert.c:144: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 version_string[10]; data/freedroidrpg-1.0~rc2/src/savegame/convert.c:155:2: [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(ptr+10, version_string, 9); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16.c:113:2: [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(new_savegame+strlen("--[[\n")+version_string->length, savegame->sav_buffer+strlen("--[[\n"), savegame->sav_buffer_size-strlen("--[[\n")); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:125: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(new_savegame, savegame->sav_buffer, offset); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:126: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(&new_savegame[offset], new, strlen(new)); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:127: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(&new_savegame[offset+strlen(new)], &savegame->sav_buffer[offset+strlen(old)], savegame->sav_buffer_size - (offset+strlen(old))); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:187:2: [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(new_savegame, savegame->sav_buffer, header_len); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:188:2: [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(new_savegame+header_len, game_config_string->value, game_config_string->length); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:189:2: [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(new_savegame+header_len+game_config_string->length, savegame->sav_buffer+header_len, savegame->sav_buffer_size-header_len); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:226:2: [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(ptr, new_config, strlen(new_config)); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:246:2: [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(ptr, "missions = {", strlen("AllMissions")); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:296: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(copy_to, copy_from, copy_len); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:321: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(copy_to, item_type_string->value, item_type_string->length); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:332:2: [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(copy_to, copy_from, copy_len); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:102:4: [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((*namelist)[i]->d_name, "INVALID"); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:110: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 last_filename[PATH_MAX] = ""; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:120: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 filename[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:121: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 filepath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:149: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 last_filename[PATH_MAX] = ""; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:150: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 info_string_date[5000] = ""; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:151: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 info_string_size[5000] = ""; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:158: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 filename[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:159: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 filepath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:213:3: [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(info_string_size, _("File Size: %2.3f MB"), ((float)file_size) / (1024.0 * 1024.0)); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:229: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 filepath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:247: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 filepath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:248: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 backup_filepath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:294:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((savegame_file = fopen(filepath, "wb")) == NULL) { data/freedroidrpg-1.0~rc2/src/saveloadgame.c: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 file_path[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:340: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 ship_filepath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:341: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 sav_filepath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/saveloadgame.c:377: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 *data_file = fopen(sav_filepath, "rb"); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:391: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). data_file = fopen(sav_filepath, "wb"); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:399: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). data_file = fopen(sav_filepath, "rb"); data/freedroidrpg-1.0~rc2/src/savestruct_internal.c:409: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 line[101]; data/freedroidrpg-1.0~rc2/src/scandir.c:73: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(v[i++], d, dsize); data/freedroidrpg-1.0~rc2/src/shop.c:213: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 LastImageSeriesPrefix[1000] = "NONE_AT_ALL"; data/freedroidrpg-1.0~rc2/src/shop.c:224: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(&item_rotation_img[i], &empty, sizeof(struct image)); data/freedroidrpg-1.0~rc2/src/shop.c:237: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 ConstructedFileName[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/shop.c:238: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/shop.c:358: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 GoldString[1000]; data/freedroidrpg-1.0~rc2/src/shop.c:490:3: [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(GoldString, "%6d", (int)Me.Gold); data/freedroidrpg-1.0~rc2/src/skills.c:705: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 filename[1000]; data/freedroidrpg-1.0~rc2/src/skills.c:840: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 str[10]; data/freedroidrpg-1.0~rc2/src/skills.c:841:4: [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(str, "F%d\n", 5 + sci); data/freedroidrpg-1.0~rc2/src/skills.c:854: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 char_text[1000]; data/freedroidrpg-1.0~rc2/src/skills.c:857:3: [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(char_text, _("Program revision: %c%d%c "), font_switchto_msgvar[0], Me.skill_level[skill_of_this_slot], data/freedroidrpg-1.0~rc2/src/skills.c:866:5: [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(char_text, _("Heat produced: %c%d%c "), font_switchto_msgvar[0], tmp, font_switchto_msgstat[0]); data/freedroidrpg-1.0~rc2/src/skills.c:868:5: [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(char_text, _("Cooling: %c%d%c "), font_switchto_msgvar[0], -tmp, font_switchto_msgstat[0]); data/freedroidrpg-1.0~rc2/src/skills.c:878:6: [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(char_text, _("Damage: %c%d%c "), font_switchto_msgvar[0], tmp, font_switchto_msgstat[0]); data/freedroidrpg-1.0~rc2/src/skills.c:880:6: [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(char_text, _("Damage: %c%d-%d%c "), font_switchto_msgvar[0], tmp, tmp2, data/freedroidrpg-1.0~rc2/src/skills.c:884:6: [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(char_text, _("Healing: %c%d%c "), font_switchto_msgvar[0], -tmp, font_switchto_msgstat[0]); data/freedroidrpg-1.0~rc2/src/skills.c:886:6: [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(char_text, _("Healing: %c%d-%d%c "), font_switchto_msgvar[0], -tmp, -tmp2, data/freedroidrpg-1.0~rc2/src/skills.c:895:5: [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(char_text, _("Paralyze")); data/freedroidrpg-1.0~rc2/src/skills.c:897:5: [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(char_text, _("Slow down")); data/freedroidrpg-1.0~rc2/src/skills.c:899:5: [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(char_text, _("Invisible")); data/freedroidrpg-1.0~rc2/src/skills.c:901:5: [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(char_text, _("Poison")); data/freedroidrpg-1.0~rc2/src/skills.c:904:5: [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(char_text, _("Takeover charges: %c%d%c "), font_switchto_msgvar[0], tmp, font_switchto_msgstat[0]); data/freedroidrpg-1.0~rc2/src/skills.c:906:5: [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(char_text, _("Escape")); data/freedroidrpg-1.0~rc2/src/skills.c:908:5: [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(char_text, _("Passive")); data/freedroidrpg-1.0~rc2/src/skills.c:914:5: [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(char_text, _("Repair items, degrading them a bit")); data/freedroidrpg-1.0~rc2/src/skills.c:916:5: [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(char_text, _("Detect enemies")); data/freedroidrpg-1.0~rc2/src/skills.c:918:5: [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(char_text, _("Lighten area")); data/freedroidrpg-1.0~rc2/src/skills.c:920:5: [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(char_text, _("Turn damage into heat")); data/freedroidrpg-1.0~rc2/src/skills.c:926:5: [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(char_text + strlen(char_text), _(" for %c%.1f%c seconds"), font_switchto_msgvar[0], dur, data/freedroidrpg-1.0~rc2/src/sound.c:333: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/sound.c:651: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/sound_effects.c:147: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 sample_path[1024]; data/freedroidrpg-1.0~rc2/src/sound_effects.c:160: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 final_file_name[5000]; data/freedroidrpg-1.0~rc2/src/sound_effects.c:170:2: [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(final_file_name, "effects/item_sounds/"); data/freedroidrpg-1.0~rc2/src/sound_effects.c:323: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 sound_file[100] = "effects/bullets/"; data/freedroidrpg-1.0~rc2/src/sound_effects.c:356: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/sound_effects.c:361:2: [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(fpath, "effects/"); data/freedroidrpg-1.0~rc2/src/struct.h:548: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. typedef char automap_data_t[100][100]; data/freedroidrpg-1.0~rc2/src/struct.h:1073: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 part_names[ALL_PART_GROUPS][64]; data/freedroidrpg-1.0~rc2/src/struct.h:1128: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 path[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/takeover.c:168: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 filename[5000]; data/freedroidrpg-1.0~rc2/src/takeover.c:256: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 count_text[80]; data/freedroidrpg-1.0~rc2/src/takeover.c:321:3: [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(count_text, _("Color-%d.%d"), countdown/10, countdown%10); data/freedroidrpg-1.0~rc2/src/takeover.c:338: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 count_text[80]; data/freedroidrpg-1.0~rc2/src/takeover.c:405:4: [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(count_text, _("Finish-%d.%d"), countdown/10, countdown%10); data/freedroidrpg-1.0~rc2/src/takeover.c:1699: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 left_box[LEFT_TEXT_LEN + 10]; data/freedroidrpg-1.0~rc2/src/takeover.c:1700: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 right_box[RIGHT_TEXT_LEN + 10]; data/freedroidrpg-1.0~rc2/src/text.c:335: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 text[100]; data/freedroidrpg-1.0~rc2/src/text_public.c:503: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 *data_file = fopen(filename, "rb"); data/freedroidrpg-1.0~rc2/src/text_public.c:877:2: [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(*DataBuffer, temp_dbuffer, strm.total_out); data/freedroidrpg-1.0~rc2/src/text_public.c:893:11: [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 out[CHUNK]; data/freedroidrpg-1.0~rc2/src/title.c:133: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 *image[3]; data/freedroidrpg-1.0~rc2/src/vars.h:38: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 *AllSkillTexts[NUMBER_OF_SKILL_LEVELS] = { data/freedroidrpg-1.0~rc2/src/view.c:1780: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 *numbers[2][2] = { {"3", "9"}, {"1", "7"} }; data/freedroidrpg-1.0~rc2/src/view.c:2146: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/view.c:2338: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 txt[256]; data/freedroidrpg-1.0~rc2/src/view.c:2786: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 constructed_filename[5000]; data/freedroidrpg-1.0~rc2/src/view.c:2796:5: [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(constructed_filename, "radial_spells/blue_sparks_%d.png", k); data/freedroidrpg-1.0~rc2/src/view.c:2799:5: [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(constructed_filename, "radial_spells/green_mist_%d.png", k); data/freedroidrpg-1.0~rc2/src/view.c:2802:5: [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(constructed_filename, "radial_spells/red_fire_%d.png", k); data/freedroidrpg-1.0~rc2/src/view.c:2809: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 fpath[PATH_MAX]; data/freedroidrpg-1.0~rc2/src/view.c:3079: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 amount[4]; data/freedroidrpg-1.0~rc2/src/view.c:3081:5: [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(amount, "%03d", Me.Inventory[SlotNum].multiplicity); data/freedroidrpg-1.0~rc2/src/view.c:3083: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(amount, "+++"); data/freedroidrpg-1.0~rc2/src/widgets/widget_background.c:166: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 file[strlen(base_name) + 16]; data/freedroidrpg-1.0~rc2/src/widgets/widgets.c:246: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[strlen(tooltip_text) + 1]; data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:9: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 fpath[4096]; data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:12: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). FILE *offset_file = fopen(fpath, "w"); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:35: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 basename[4096]; data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c: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 element_filename[PATH_MAX]; data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:85:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *fd = fopen(fpath, "r"); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:111: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 atlas_directory[PATH_MAX]; data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:112: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 atlas_path[PATH_MAX]; data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:113: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 output_directory[PATH_MAX]; data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:90: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). atlas_file = fopen(output_path, "w"); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:93: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 path[2048]; data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:111: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 path[2048]; data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:238: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 offset_file_name[10000] = ""; data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:249:2: [2] (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). Risk is low because the source is a constant string. strcat(offset_file_name, ".offset"); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:251: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). if ((OffsetFile = fopen(offset_file_name, "rb")) == NULL) { data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:273:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). img->xoff = atoi(p); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:278:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). img->yoff = atoi(p); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:288: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 fn[1024] = ""; data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:366:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atlas_width = atoi(argv[4]); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:367:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atlas_height = atoi(argv[5]); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:374:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atlas_width = atoi(argv[2]); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:375:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atlas_height = atoi(argv[3]); data/freedroidrpg-1.0~rc2/tools/font/codeset.c:522: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 str[2048]; data/freedroidrpg-1.0~rc2/tools/font/codeset.c:648: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 font_char_name[4096]; data/freedroidrpg-1.0~rc2/tools/font/make_bmchars.c:258:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). font_size = atoi(argv[4]); data/freedroidrpg-1.0~rc2/tools/font/make_bmchars.c:260:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). outlined = atoi(argv[6]); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:277:19: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). debug_level = atoi(optarg); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:588: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 filename[10000]; data/freedroidrpg-1.0~rc2/tools/image/croppy.c:596:2: [2] (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). Risk is low because the source is a constant string. strcat(filename, ".offset"); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:599:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((offset_file = fopen(filename, "r")) == NULL) data/freedroidrpg-1.0~rc2/tools/image/croppy.c:634: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 filename[10000]; data/freedroidrpg-1.0~rc2/tools/image/croppy.c:655:3: [2] (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). Risk is low because the source is a constant string. strcat(filename, ".offset"); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:658:3: [2] (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). Risk is low because the source is a constant string. strcat(filename, ".offset"); data/freedroidrpg-1.0~rc2/tools/image/croppy.c:664: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). if ((OffsetFile = fopen(filename, "w")) == NULL) { data/freedroidrpg-1.0~rc2/lua/lauxlib.c:385: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). *len = (def ? strlen(def) : 0); data/freedroidrpg-1.0~rc2/lua/lauxlib.c:478:25: [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). luaL_addlstring(B, s, strlen(s)); data/freedroidrpg-1.0~rc2/lua/lauxlib.c:612:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(lf->f); data/freedroidrpg-1.0~rc2/lua/lauxlib.c:617:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return getc(lf->f); /* return next character */ data/freedroidrpg-1.0~rc2/lua/lauxlib.c:632:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(lf->f); data/freedroidrpg-1.0~rc2/lua/lauxlib.c:634:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). *cp = getc(lf->f); /* skip end-of-line, if present */ data/freedroidrpg-1.0~rc2/lua/lauxlib.c:703:32: [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). return luaL_loadbuffer(L, s, strlen(s), s); data/freedroidrpg-1.0~rc2/lua/lauxlib.c:790:32: [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 (e == NULL) e = fname + strlen(fname); data/freedroidrpg-1.0~rc2/lua/lauxlib.c:923: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). size_t l = strlen(p); data/freedroidrpg-1.0~rc2/lua/ldblib.c:409: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). if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || data/freedroidrpg-1.0~rc2/lua/liolib.c:83:20: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define l_getc(f) getc(f) data/freedroidrpg-1.0~rc2/lua/liolib.c:453:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc(f); data/freedroidrpg-1.0~rc2/lua/loadlib.c:390:29: [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 (l == NULL) l = path + strlen(path); data/freedroidrpg-1.0~rc2/lua/lobject.c:368:23: [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). pushstr(L, s, strlen(s)); data/freedroidrpg-1.0~rc2/lua/lobject.c:419:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). pushstr(L, fmt, strlen(fmt)); data/freedroidrpg-1.0~rc2/lua/lobject.c:445: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). size_t l = strlen(source); data/freedroidrpg-1.0~rc2/lua/lstring.c:207: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). TString *s = luaS_newlstr(L, str, strlen(str)); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:581:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). upto += strlen(p + upto) + 1; /* may have more after \0 */ data/freedroidrpg-1.0~rc2/lua/lstrlib.c:839: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). return strlen(buff); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:947: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). size_t l = strlen(form); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:948:15: [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 lm = strlen(lenmod); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:1330: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). luaL_argcheck(L, strlen(s) == len, arg, "string contains zeros"); data/freedroidrpg-1.0~rc2/lua/lstrlib.c:1454: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). size_t len = (int)strlen(data + pos); data/freedroidrpg-1.0~rc2/lua/lua.c:211:34: [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). lua_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT)); data/freedroidrpg-1.0~rc2/lua/lua.c:249: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). return dochunk(L, luaL_loadbuffer(L, s, strlen(s), name)); data/freedroidrpg-1.0~rc2/lua/lua.c:314:7: [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). l = strlen(b); data/freedroidrpg-1.0~rc2/lua/lundump.c:217:16: [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 len = strlen(s); data/freedroidrpg-1.0~rc2/lua/lvm.c:245:20: [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 len = strlen(l); /* index of first '\0' in both strings */ data/freedroidrpg-1.0~rc2/src/blocks.c:345:7: [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(bullet_spec->name) && strstr(bullet_spec->name, "NO BULLET IMAGE")) data/freedroidrpg-1.0~rc2/src/blocks.c:373:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). offset_file_name[strlen(offset_file_name) - 4] = 0; data/freedroidrpg-1.0~rc2/src/blocks.c:397:112: [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). ReadValueFromString(offset_data, OFFSET_FILE_OFFSETX_STRING, "%hd", &(our_iso_image->offset_x), offset_data + strlen(offset_data)); data/freedroidrpg-1.0~rc2/src/blocks.c:399:112: [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). ReadValueFromString(offset_data, OFFSET_FILE_OFFSETY_STRING, "%hd", &(our_iso_image->offset_y), offset_data + strlen(offset_data)); data/freedroidrpg-1.0~rc2/src/blocks.c:547:45: [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). const char *obstacle_filename = filename + strlen("shadow_"); data/freedroidrpg-1.0~rc2/src/character.c:472: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). sprintf(CharText + strlen(CharText), " (%+d)", Me.strength - Me.base_strength); data/freedroidrpg-1.0~rc2/src/character.c:480: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). sprintf(CharText + strlen(CharText), " (%+d)", Me.dexterity - Me.base_dexterity); data/freedroidrpg-1.0~rc2/src/character.c:488: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). sprintf(CharText + strlen(CharText), " (%+d)", Me.physique - Me.base_physique); data/freedroidrpg-1.0~rc2/src/character.c:496: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). sprintf(CharText + strlen(CharText), " (%+d)", Me.cooling - Me.base_cooling); data/freedroidrpg-1.0~rc2/src/event.c:197:20: [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). event_pointer += strlen(EVENT_TRIGGER_BEGIN_STRING) + 1; data/freedroidrpg-1.0~rc2/src/event.c:200:25: [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). char s = end_of_event[strlen(EVENT_TRIGGER_END_STRING) - 1]; data/freedroidrpg-1.0~rc2/src/event.c:201:16: [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). end_of_event[strlen(EVENT_TRIGGER_END_STRING) - 1] = '\0'; data/freedroidrpg-1.0~rc2/src/event.c:285:16: [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). end_of_event[strlen(EVENT_TRIGGER_END_STRING) - 1] = s; data/freedroidrpg-1.0~rc2/src/game_act.c:50:82: [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 nb = snprintf(unresolved_path, PATH_MAX, "%s%s%s", tmp, act->subdir, start+strlen(key)); data/freedroidrpg-1.0~rc2/src/game_act.c:53:67: [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). PLEASE_INFORM | IS_FATAL, tmp, act->subdir, start+strlen(key)); data/freedroidrpg-1.0~rc2/src/game_act.c:121:20: [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 (!act_name || !strlen(act_name)) data/freedroidrpg-1.0~rc2/src/game_act.c:141: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). if (!act_id || !strlen(act_id)) data/freedroidrpg-1.0~rc2/src/game_act.c:207:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). PLEASE_INFORM, (strlen(act_id) != 0) ? act_id : "NULL"); data/freedroidrpg-1.0~rc2/src/getopt.c:234: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). # if (!defined __STDC__ || !__STDC__) && !defined strlen data/freedroidrpg-1.0~rc2/src/getopt.c:237: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). extern int strlen(const char *); data/freedroidrpg-1.0~rc2/src/getopt.c:414: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). int len = nonoption_flags_max_len = strlen(orig_str); data/freedroidrpg-1.0~rc2/src/getopt.c:620: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). == (unsigned int)strlen(p->name)) { data/freedroidrpg-1.0~rc2/src/getopt.c:638:16: [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). nextchar += strlen(nextchar); data/freedroidrpg-1.0~rc2/src/getopt.c:664:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nextchar += strlen(nextchar); data/freedroidrpg-1.0~rc2/src/getopt.c:676: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). nextchar += strlen(nextchar); data/freedroidrpg-1.0~rc2/src/getopt.c:681:16: [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). nextchar += strlen(nextchar); data/freedroidrpg-1.0~rc2/src/getopt.c:774: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). if ((unsigned int)(nameend - nextchar) == strlen(p->name)) { data/freedroidrpg-1.0~rc2/src/getopt.c:791:17: [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). nextchar += strlen(nextchar); data/freedroidrpg-1.0~rc2/src/getopt.c:807:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nextchar += strlen(nextchar); data/freedroidrpg-1.0~rc2/src/getopt.c:817:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nextchar += strlen(nextchar); data/freedroidrpg-1.0~rc2/src/getopt.c:821:17: [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). nextchar += strlen(nextchar); data/freedroidrpg-1.0~rc2/src/hud.c:461: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). char buffer[strlen(text) + 1]; data/freedroidrpg-1.0~rc2/src/hud.c:656:4: [1] (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). Risk is low because the source is a constant character. strcat(level_name_and_time, " "); data/freedroidrpg-1.0~rc2/src/hud.c:663:4: [1] (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). Risk is low because the source is a constant character. strcat(level_name_and_time, " "); data/freedroidrpg-1.0~rc2/src/init.c:214:20: [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 in_len = strlen(screen.text); data/freedroidrpg-1.0~rc2/src/init.c:246:29: [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). char *ptr = screen.text + strlen(screen.text) - 1; data/freedroidrpg-1.0~rc2/src/keyboard.c:585:83: [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). } else if (!strncmp(GameConfig.input_keybinds[keynum].name, "activate_program", strlen("activate_program")) data/freedroidrpg-1.0~rc2/src/keyboard.c:587:63: [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 number = atoi(GameConfig.input_keybinds[keynum].name + strlen("activate_program")); data/freedroidrpg-1.0~rc2/src/keyboard.c:605:82: [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). } else if (!strncmp(GameConfig.input_keybinds[keynum].name, "quick_inventory", strlen("quick_inventory")) data/freedroidrpg-1.0~rc2/src/keyboard.c:607:63: [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 number = atoi(GameConfig.input_keybinds[keynum].name + strlen("quick_inventory")); data/freedroidrpg-1.0~rc2/src/keyboard.c:712:84: [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). } else if (!strncmp(GameConfig.input_keybinds[keynum].name, "place_obstacle_kp", strlen("place_obstacle_kp")) data/freedroidrpg-1.0~rc2/src/keyboard.c:714:63: [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 number = atoi(GameConfig.input_keybinds[keynum].name + strlen("place_obstacle_kp")); data/freedroidrpg-1.0~rc2/src/lang.c:125:16: [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 (locale && strlen(locale)) { data/freedroidrpg-1.0~rc2/src/lang.c:134:17: [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 (!locale || strlen(locale) == 0) { data/freedroidrpg-1.0~rc2/src/lang.c:154:17: [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 (locale && strlen(locale)) data/freedroidrpg-1.0~rc2/src/lang.c:163: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). if (applied_locale && strlen(applied_locale) != 0) { data/freedroidrpg-1.0~rc2/src/lang.c:214: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). if (GameConfig.locale && strlen(GameConfig.locale) != 0) { data/freedroidrpg-1.0~rc2/src/lang.c:259: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(localedir) == 0) { data/freedroidrpg-1.0~rc2/src/lua.c:1616:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int nres = strlen(sig); data/freedroidrpg-1.0~rc2/src/lua.c:1730:23: [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 narg = (insig) ? strlen(insig) : 0; /* number of arguments */ data/freedroidrpg-1.0~rc2/src/lua.c:1731: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 nres = (outsig) ? strlen(outsig) : 0; /* number of results */ data/freedroidrpg-1.0~rc2/src/lua.c:1851: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). new_coroutine->nargs = (insig) ? strlen(insig) : 0; data/freedroidrpg-1.0~rc2/src/lvledit/lvledit.c:221:2: [1] (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 character. strcpy(VanishingMessage, ""); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_actions.c:264:16: [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 (!name || !strlen(name)) data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_actions.c:598:16: [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 (!name || !strlen(name)) data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_actions.c:624:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(suggested_label, old_name, sizeof(suggested_label) - 1); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_actions.c:653:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(suggested_label, name, sizeof(suggested_label) - 1); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:508: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). sprintf(options[i] + strlen(options[i]), _(" N: %d"), EditLevel()->jump_target_north); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:510: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). sprintf(options[i] + strlen(options[i]), _(" E: %d"), EditLevel()->jump_target_east); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:512: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). sprintf(options[i] + strlen(options[i]), _(" S: %d"), EditLevel()->jump_target_south); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:514: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). sprintf(options[i] + strlen(options[i]), _(" W: %d"), EditLevel()->jump_target_west); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:549: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(class, _("None"), 15); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_menu.c:643:5: [1] (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 character. strcpy(class, ""); data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:524:25: [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 (!validator_type || strlen(validator_type) != 2) { data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:1116:25: [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 (!validator_type || strlen(validator_type) != 2) { data/freedroidrpg-1.0~rc2/src/lvledit/lvledit_validator.c:1276:25: [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 (!validator_type || strlen(validator_type) != 2) { data/freedroidrpg-1.0~rc2/src/map.c:214:8: [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). fp += strlen(LEVEL_HEADER_LEVELNUMBER); data/freedroidrpg-1.0~rc2/src/map.c:224:8: [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). fp += strlen("xlen of this level:"); data/freedroidrpg-1.0~rc2/src/map.c:234:8: [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). fp += strlen("ylen of this level:"); data/freedroidrpg-1.0~rc2/src/map.c:244:8: [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). fp += strlen("floor layers:"); data/freedroidrpg-1.0~rc2/src/map.c:254:8: [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). fp += strlen("light radius bonus of this level:"); data/freedroidrpg-1.0~rc2/src/map.c:263:8: [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). fp += strlen("minimal light on this level:"); data/freedroidrpg-1.0~rc2/src/map.c:272:8: [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). fp += strlen("infinite_running_on_this_level:"); data/freedroidrpg-1.0~rc2/src/map.c:281:8: [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). fp += strlen("random dungeon:"); data/freedroidrpg-1.0~rc2/src/map.c:290: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). if (!strncmp(fp, TELEPORT_PAIR_STRING, strlen(TELEPORT_PAIR_STRING))) { data/freedroidrpg-1.0~rc2/src/map.c:291:9: [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). fp += strlen(TELEPORT_PAIR_STRING); data/freedroidrpg-1.0~rc2/src/map.c:304:9: [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). fp += strlen("dungeon generated:"); data/freedroidrpg-1.0~rc2/src/map.c:317:9: [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). fp += strlen("environmental flags:"); data/freedroidrpg-1.0~rc2/src/map.c:330:9: [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). fp += strlen("item drop class:"); data/freedroidrpg-1.0~rc2/src/map.c:389:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(type_indication_string, droid_type_ptr, droid_type_length); data/freedroidrpg-1.0~rc2/src/map.c:446:95: [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). char *obstacle_SectionBegin = LocateStringInData(data_pointer, OBSTACLE_DATA_BEGIN_STRING) + strlen(OBSTACLE_DATA_BEGIN_STRING) + 1; data/freedroidrpg-1.0~rc2/src/map.c:506:77: [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). char *map_label_begin = LocateStringInData(data, MAP_LABEL_BEGIN_STRING) + strlen(MAP_LABEL_BEGIN_STRING) + 1; data/freedroidrpg-1.0~rc2/src/map.c:811:15: [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). map_begin += strlen(MAP_BEGIN_STRING) + 1; data/freedroidrpg-1.0~rc2/src/map.c:890: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). wp_begin += strlen(WP_BEGIN_STRING) + 1; data/freedroidrpg-1.0~rc2/src/map.c:910: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 (!strncmp(this_line, wp_end, strlen(WP_END_STRING))) { data/freedroidrpg-1.0~rc2/src/map.c:933:11: [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). pos += strlen(CONNECTION_STRING); // skip connection-string data/freedroidrpg-1.0~rc2/src/map.c:1320: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). pos += strlen(LEVEL_END_STRING) + 1; data/freedroidrpg-1.0~rc2/src/map.c:1854: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). DroidSectionPointer += strlen(DROIDS_LEVEL_DESCRIPTION_START_STRING); data/freedroidrpg-1.0~rc2/src/map.c:1880:45: [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). char *special_droid_end = special_droid + strlen(special_droid); data/freedroidrpg-1.0~rc2/src/map.c:1881: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). search_pointer += strlen(SPECIAL_FORCE_INDICATION_STRING); data/freedroidrpg-1.0~rc2/src/map.c:1890:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(type_indication_string, special_droid, droid_type_length); data/freedroidrpg-1.0~rc2/src/menu.c:196: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(header_text) != 0) { data/freedroidrpg-1.0~rc2/src/menu.c:214: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(header_text) != 0) { data/freedroidrpg-1.0~rc2/src/menu.c:349:7: [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(header_text) > 0) { data/freedroidrpg-1.0~rc2/src/menu.c:967: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(MenuTexts[i++], _("Play"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:968: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(MenuTexts[i++], _("Tutorial"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:969: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(MenuTexts[i++], _("Level Editor"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:970: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(MenuTexts[i++], _("Options"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:971: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(MenuTexts[i++], _("Credits"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:972: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(MenuTexts[i++], _("Contribute"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:973: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(MenuTexts[i++], _("Exit FreedroidRPG"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1009: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(MenuTexts[1], _("Back"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1062: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(MenuTexts[i++], _("Gameplay"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1063: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(MenuTexts[i++], _("Graphics"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1064: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(MenuTexts[i++], _("Sound"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1065: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(MenuTexts[i++], _("Keys"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1067: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(MenuTexts[i++], _("Languages"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1069: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(MenuTexts[i++], _("On-Screen displays"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1070: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(MenuTexts[i++], _("Performance tweaks"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1071: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(MenuTexts[i++], _("Back"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1118:3: [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(MenuTexts[0], _("Resume Play"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1120:3: [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(MenuTexts[0], _("Resume Playtest"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1122: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(MenuTexts[1], _("Save Hero"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1123: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(MenuTexts[2], _("Options"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1124: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(MenuTexts[3], _("Load Latest"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1125: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(MenuTexts[4], _("Load Backup"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1127:3: [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(MenuTexts[5], _("Quit to Main Menu"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1129:3: [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(MenuTexts[5], _("Return to Level Editor"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1130: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(MenuTexts[6], _("Exit FreedroidRPG"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1174:28: [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 (!GameConfig.locale || strlen(GameConfig.locale) == 0) data/freedroidrpg-1.0~rc2/src/menu.c:1269: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(MenuTexts[j++], _("Back"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1323:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(MenuTexts[i], Options[i], 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1327:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(MenuTexts[i], Options[i], 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1330: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(MenuTexts[i++], _("Back"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1414:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(MenuTexts[i], Options[i], 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1418:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(MenuTexts[i], Options[i], 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1438:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(MenuTexts[i], Options[i], 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1441: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(MenuTexts[i++], _("Back"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1509:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(MenuTexts[i], Options[i], 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1512:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(MenuTexts[i], Options[i], 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1515:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(MenuTexts[i], Options[i], 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1521: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(MenuTexts[i++], _("Back"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1594: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(MenuTexts[i++], _("Back"), 1024); data/freedroidrpg-1.0~rc2/src/menu.c:1653:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (i = 0; i < strlen(str); i++) data/freedroidrpg-1.0~rc2/src/menu.c:1670: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_CHARACTER_NAME_LENGTH) { data/freedroidrpg-1.0~rc2/src/menu.c:1878: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). if (char_name && strlen(char_name)) { data/freedroidrpg-1.0~rc2/src/misc.c:646:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(data_dirs[DATA_ROOT].path, top_data_dir[i], PATH_MAX-1); data/freedroidrpg-1.0~rc2/src/misc.c:649:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(data_dirs[LOCALE_ROOT].path, top_locale_dir[i], PATH_MAX-1); data/freedroidrpg-1.0~rc2/src/misc.c:838: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 fname_length = strlen(fname); data/freedroidrpg-1.0~rc2/src/misc.c:839:23: [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 suffix_length = strlen(suffix); data/freedroidrpg-1.0~rc2/src/misc.c:884: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). if (!used_locale || strlen(used_locale) == 0) { data/freedroidrpg-1.0~rc2/src/misc.c:894: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). for (i = -1; i < (int)strlen(sep); i++) { data/freedroidrpg-1.0~rc2/src/misc.c:935:25: [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 (!used_encoding || !strlen(used_encoding) || !strcmp(used_encoding, "ASCII")) { data/freedroidrpg-1.0~rc2/src/misc.c:1333:7: [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(data_dirs[CONFIG_DIR].path)) { data/freedroidrpg-1.0~rc2/src/misc.c:1417:7: [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(data_dirs[CONFIG_DIR].path)) { data/freedroidrpg-1.0~rc2/src/misc.c:1551:25: [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). char *cmd = MyMalloc(strlen(OPENTXT_CMD) + strlen(outfn) + 2); // +1 for the whitespace after the cmd name +1 for the terminating \0 data/freedroidrpg-1.0~rc2/src/misc.c:1551: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). char *cmd = MyMalloc(strlen(OPENTXT_CMD) + strlen(outfn) + 2); // +1 for the whitespace after the cmd name +1 for the terminating \0 data/freedroidrpg-1.0~rc2/src/misc.c:1634: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). const size_t len = strlen(var) + 1 + strlen(val) + 2; data/freedroidrpg-1.0~rc2/src/misc.c:1634: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). const size_t len = strlen(var) + 1 + strlen(val) + 2; data/freedroidrpg-1.0~rc2/src/misc.c:1665: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). const size_t len = strlen(var) + 2; data/freedroidrpg-1.0~rc2/src/open_gl.c:723:15: [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 (!str || strlen(str) < 3) { data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c:61: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 directory_len = strlen(directory); data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c:76:8: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (!sscanf(dat, "* %1023s size %d %d", filename, &width, &height)) { data/freedroidrpg-1.0~rc2/src/open_gl_atlas.c:96:9: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (!sscanf(dat, "%1023s %d %d %d %d off %d %d", &element_key[0], &x, &y, &w, &h, &xoff, &yoff)) { data/freedroidrpg-1.0~rc2/src/open_gl_debug.c:156:25: [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). glStringMarkerGREMEDY(strlen(str), str); data/freedroidrpg-1.0~rc2/src/savegame/convert.c:206:9: [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). ptr += strlen("savegame_version_string = "); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16.c:42: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). if (strncmp(ptr+strlen("savegame_version_string = "), "\"0.16;sizeof", strlen("\"0.16;sizeof"))) { data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16.c:42:73: [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 (strncmp(ptr+strlen("savegame_version_string = "), "\"0.16;sizeof", strlen("\"0.16;sizeof"))) { data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16.c:113: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). memcpy(new_savegame+strlen("--[[\n")+version_string->length, savegame->sav_buffer+strlen("--[[\n"), savegame->sav_buffer_size-strlen("--[[\n")); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16.c:113:84: [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). memcpy(new_savegame+strlen("--[[\n")+version_string->length, savegame->sav_buffer+strlen("--[[\n"), savegame->sav_buffer_size-strlen("--[[\n")); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16.c:113:128: [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). memcpy(new_savegame+strlen("--[[\n")+version_string->length, savegame->sav_buffer+strlen("--[[\n"), savegame->sav_buffer_size-strlen("--[[\n")); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:44: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). char *object_start = array_start + strlen(section) + 1; data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:85: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). type_start += strlen(type); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:86: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). if (!strncmp(type_start, infout, strlen(infout))) { data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:108:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int length_old = strlen(old); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:109:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int length_new = strlen(new); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:114:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(array_start, new, length_new+1); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:126:38: [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). memcpy(&new_savegame[offset], new, strlen(new)); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:127:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy(&new_savegame[offset+strlen(new)], &savegame->sav_buffer[offset+strlen(old)], savegame->sav_buffer_size - (offset+strlen(old))); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:127:74: [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). memcpy(&new_savegame[offset+strlen(new)], &savegame->sav_buffer[offset+strlen(old)], savegame->sav_buffer_size - (offset+strlen(old))); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:127:124: [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). memcpy(&new_savegame[offset+strlen(new)], &savegame->sav_buffer[offset+strlen(old)], savegame->sav_buffer_size - (offset+strlen(old))); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:171:9: [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). ptr += strlen("--]]\n\n"); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:208:9: [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). ptr += strlen("--]]\n\n"); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:215: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). if (strncmp(ptr, searched_config, strlen(searched_config))) { data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:226: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). memcpy(ptr, new_config, strlen(new_config)); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:246:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy(ptr, "missions = {", strlen("AllMissions")); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:300: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). ptr += strlen(",\ntype = "); data/freedroidrpg-1.0~rc2/src/savegame/filters_0_16_1.c:337: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). savegame->sav_buffer_size = strlen(savegame->sav_buffer); data/freedroidrpg-1.0~rc2/src/saveloadgame.c:68:7: [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(pos) == strlen(SAVEDGAME_EXT)) { data/freedroidrpg-1.0~rc2/src/saveloadgame.c:68: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). if (strlen(pos) == strlen(SAVEDGAME_EXT)) { data/freedroidrpg-1.0~rc2/src/saveloadgame.c:101:8: [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((*namelist)[i]->d_name)) data/freedroidrpg-1.0~rc2/src/saveloadgame.c:117:8: [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(data_dirs[CONFIG_DIR].path)) data/freedroidrpg-1.0~rc2/src/saveloadgame.c:155:8: [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(data_dirs[CONFIG_DIR].path)) data/freedroidrpg-1.0~rc2/src/saveloadgame.c:231:7: [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(data_dirs[CONFIG_DIR].path)) data/freedroidrpg-1.0~rc2/src/saveloadgame.c:257:7: [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(data_dirs[CONFIG_DIR].path)) data/freedroidrpg-1.0~rc2/src/saveloadgame.c:343:7: [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(data_dirs[CONFIG_DIR].path)) { data/freedroidrpg-1.0~rc2/src/savestruct_internal.c:226: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(str)) { data/freedroidrpg-1.0~rc2/src/savestruct_internal.c:258: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(str) && strncmp(str, "none", 4)) { data/freedroidrpg-1.0~rc2/src/skills.c:910:5: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(char_text, " "); data/freedroidrpg-1.0~rc2/src/skills.c:912:5: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(char_text, " "); data/freedroidrpg-1.0~rc2/src/skills.c:922:5: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(char_text, " "); data/freedroidrpg-1.0~rc2/src/skills.c:926:25: [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). sprintf(char_text + strlen(char_text), _(" for %c%.1f%c seconds"), font_switchto_msgvar[0], dur, data/freedroidrpg-1.0~rc2/src/system.h:106:25: [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). # define NAMLEN(dirent) strlen((dirent)->d_name) data/freedroidrpg-1.0~rc2/src/takeover.c:351:2: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(count_text, " "); /* Make sure a value gets assigned to count_text */ data/freedroidrpg-1.0~rc2/src/takeover.c:1714:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). left_len = strlen(left); data/freedroidrpg-1.0~rc2/src/takeover.c:1719: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). right_len = strlen(right); data/freedroidrpg-1.0~rc2/src/takeover.c:1728:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(left_box, left, left_len); // this drops terminating \0 ! data/freedroidrpg-1.0~rc2/src/takeover.c:1729:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(right_box, right, right_len); // this drops terminating \0 ! data/freedroidrpg-1.0~rc2/src/text.c:296: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). Me.BigScreenMessage[0] = MyMalloc(strlen(ScreenMessageText) + 1); data/freedroidrpg-1.0~rc2/src/text.c:645:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(input, default_string, max_len); data/freedroidrpg-1.0~rc2/src/text.c:647:15: [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 curpos = strlen(input); // counts the characters entered so far data/freedroidrpg-1.0~rc2/src/text.c:689: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 (popup_window_title[strlen(popup_window_title) - 1] != '\n') data/freedroidrpg-1.0~rc2/src/text.c:713:23: [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 (curpos < ((int)strlen(input))) data/freedroidrpg-1.0~rc2/src/text.c:729:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((int)strlen(input) < max_len) { data/freedroidrpg-1.0~rc2/src/text.c:737: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 (curpos == ((int)strlen(input))) { data/freedroidrpg-1.0~rc2/src/text.c:741:25: [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 (int i = (int)strlen(input); i >= curpos; i--) { data/freedroidrpg-1.0~rc2/src/text.c:790: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). if (tmp[strlen(tmp) - 1] == '\n') { data/freedroidrpg-1.0~rc2/src/text.c:795:25: [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 < ((int)strlen(tmp)); i++) data/freedroidrpg-1.0~rc2/src/text_public.c:428:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SearchPointer += strlen(StartIndicationString); data/freedroidrpg-1.0~rc2/src/text_public.c:447:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ReturnString, SearchPointer, StringLength); data/freedroidrpg-1.0~rc2/src/text_public.c:485:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). CountPointer += strlen(TargetString); data/freedroidrpg-1.0~rc2/src/text_public.c:545:98: [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). char *read_pointer = my_memmem(data, (size_t) memory_amount, (char *)file_end_string, (size_t) strlen(file_end_string)); data/freedroidrpg-1.0~rc2/src/text_public.c:604: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). SourceLocation += strlen(ValuePreceedText); data/freedroidrpg-1.0~rc2/src/text_public.c:641:20: [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). SourceLocation += strlen(ValuePreceedText); data/freedroidrpg-1.0~rc2/src/view.c:2004:23: [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 (!part_string || !strlen(part_string)) data/freedroidrpg-1.0~rc2/src/widgets/widget_background.c:166: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). char file[strlen(base_name) + 16]; data/freedroidrpg-1.0~rc2/src/widgets/widget_text_list.c:330: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). while (text_arr[i] && strlen(text_arr[i])) { data/freedroidrpg-1.0~rc2/src/widgets/widgets.c:246: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). char buffer[strlen(tooltip_text) + 1]; data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:48:23: [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 output_dir_len = strlen(output_directory); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:64:8: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (!sscanf(dptr, "%1023s %d %d %d %d off %d %d", &element_filename[output_dir_len], &x, &y, &w, &h, &x_offset, &y_offset)) data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:122:28: [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 atlas_directory_len = strlen(argv[2]); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:131:29: [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 output_directory_len = strlen(argv[3]); data/freedroidrpg-1.0~rc2/tools/atlas/explode_atlas.c:143:8: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (!sscanf(dptr, "* %1023s size %*d %*d", &atlas_path[atlas_directory_len])) data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:95: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). int img_dir_len = strlen(img_dir); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:245:3: [1] (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). Risk is low because the source is a constant character. strcat(offset_file_name, "/"); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:248:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). offset_file_name[strlen(offset_file_name) - 4] = 0; data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:271:7: [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). p += strlen(OFFSET_FILE_OFFSETX_STRING); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:276:7: [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). p += strlen(OFFSET_FILE_OFFSETY_STRING); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:290: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 img_dir_len = strlen(img_dir); data/freedroidrpg-1.0~rc2/tools/atlas/make_atlas.c:297:4: [1] (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). Risk is low because the source is a constant character. strcat(fn, "/"); data/freedroidrpg-1.0~rc2/tools/font/codeset.c:527:3: [1] (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). Risk is low because the source is a constant character. strcat(str, " "); data/freedroidrpg-1.0~rc2/tools/font/codeset.c:529: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). str[strlen(str)-1] = '\0'; data/freedroidrpg-1.0~rc2/tools/image/croppy.c:595: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). filename[strlen(filename) - 4] = '\0'; data/freedroidrpg-1.0~rc2/tools/image/croppy.c:657: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). filename[strlen(filename) - 4] = 0; ANALYSIS SUMMARY: Hits = 965 Lines analyzed = 106759 in approximately 9.84 seconds (10847 lines/second) Physical Source Lines of Code (SLOC) = 67512 Hits@level = [0] 260 [1] 262 [2] 518 [3] 24 [4] 161 [5] 0 Hits@level+ = [0+] 1225 [1+] 965 [2+] 703 [3+] 185 [4+] 161 [5+] 0 Hits/KSLOC@level+ = [0+] 18.1449 [1+] 14.2938 [2+] 10.413 [3+] 2.74025 [4+] 2.38476 [5+] 0 Dot directories skipped = 2 (--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.