Flawfinder version 1.31, (C) 2001-2014 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 169 Examining src/notifications/notifications.cc Examining src/notifications/note_ids.h Examining src/notifications/notifications.h Examining src/notifications/test/notifications_test.cc Examining src/notifications/notifications_impl.h Examining src/editor/map_generator.cc Examining src/editor/ui_menus/tool_place_critter_options_menu.h Examining src/editor/ui_menus/tool_menu.cc Examining src/editor/ui_menus/main_menu.cc Examining src/editor/ui_menus/main_menu.h Examining src/editor/ui_menus/tool_menu.h Examining src/editor/ui_menus/tool_set_terrain_options_menu.cc Examining src/editor/ui_menus/tool_change_resources_options_menu.cc Examining src/editor/ui_menus/tool_noise_height_options_menu.cc Examining src/editor/ui_menus/main_menu_new_map.h Examining src/editor/ui_menus/tool_place_immovable_options_menu.cc Examining src/editor/ui_menus/tool_options_menu.h Examining src/editor/ui_menus/main_menu_load_map.cc Examining src/editor/ui_menus/categorized_item_selection_menu.h Examining src/editor/ui_menus/help.h Examining src/editor/ui_menus/tool_noise_height_options_menu.h Examining src/editor/ui_menus/main_menu_save_map_make_directory.h Examining src/editor/ui_menus/tool_place_critter_options_menu.cc Examining src/editor/ui_menus/main_menu_load_map.h Examining src/editor/ui_menus/main_menu_new_map.cc Examining src/editor/ui_menus/toolsize_menu.h Examining src/editor/ui_menus/main_menu_save_map_make_directory.cc Examining src/editor/ui_menus/main_menu_map_options.cc Examining src/editor/ui_menus/main_menu_save_map.cc Examining src/editor/ui_menus/main_menu_load_or_save_map.cc Examining src/editor/ui_menus/main_menu_random_map.cc Examining src/editor/ui_menus/toolsize_menu.cc Examining src/editor/ui_menus/player_menu.cc Examining src/editor/ui_menus/main_menu_save_map.h Examining src/editor/ui_menus/help.cc Examining src/editor/ui_menus/tool_place_immovable_options_menu.h Examining src/editor/ui_menus/tool_change_resources_options_menu.h Examining src/editor/ui_menus/tool_change_height_options_menu.h Examining src/editor/ui_menus/main_menu_map_options.h Examining src/editor/ui_menus/tool_set_terrain_options_menu.h Examining src/editor/ui_menus/tool_change_height_options_menu.cc Examining src/editor/ui_menus/tool_options_menu.cc Examining src/editor/ui_menus/main_menu_load_or_save_map.h Examining src/editor/ui_menus/main_menu_random_map.h Examining src/editor/ui_menus/player_menu.h Examining src/editor/tools/set_starting_pos_tool.cc Examining src/editor/tools/place_critter_tool.cc Examining src/editor/tools/set_terrain_tool.cc Examining src/editor/tools/noise_height_tool.h Examining src/editor/tools/make_infrastructure_tool.cc Examining src/editor/tools/set_origin_tool.cc Examining src/editor/tools/increase_height_tool.cc Examining src/editor/tools/delete_immovable_tool.cc Examining src/editor/tools/history.cc Examining src/editor/tools/set_port_space_tool.h Examining src/editor/tools/tool_action.h Examining src/editor/tools/set_height_tool.cc Examining src/editor/tools/set_resources_tool.cc Examining src/editor/tools/increase_resources_tool.h Examining src/editor/tools/place_critter_tool.h Examining src/editor/tools/draw_tool.cc Examining src/editor/tools/delete_immovable_tool.h Examining src/editor/tools/decrease_height_tool.h Examining src/editor/tools/decrease_resources_tool.cc Examining src/editor/tools/set_starting_pos_tool.h Examining src/editor/tools/set_height_tool.h Examining src/editor/tools/set_terrain_tool.h Examining src/editor/tools/multi_select.h Examining src/editor/tools/make_infrastructure_tool.h Examining src/editor/tools/increase_height_tool.h Examining src/editor/tools/increase_resources_tool.cc Examining src/editor/tools/info_tool.cc Examining src/editor/tools/decrease_resources_tool.h Examining src/editor/tools/set_resources_tool.h Examining src/editor/tools/decrease_height_tool.cc Examining src/editor/tools/action_args.h Examining src/editor/tools/info_tool.h Examining src/editor/tools/draw_tool.h Examining src/editor/tools/delete_critter_tool.h Examining src/editor/tools/set_port_space_tool.cc Examining src/editor/tools/set_origin_tool.h Examining src/editor/tools/noise_height_tool.cc Examining src/editor/tools/place_immovable_tool.cc Examining src/editor/tools/history.h Examining src/editor/tools/tool.h Examining src/editor/tools/place_immovable_tool.h Examining src/editor/tools/delete_critter_tool.cc Examining src/editor/map_generator.h Examining src/editor/editorinteractive.h Examining src/editor/editorinteractive.cc Examining src/helper.cc Examining src/wlapplication_messages.h Examining src/third_party/gettext/gettext.h Examining src/third_party/gettext/dummy_gettext.cc Examining src/third_party/eris/lcode.h Examining src/third_party/eris/lapi.c Examining src/third_party/eris/lmem.c Examining src/third_party/eris/lctype.h Examining src/third_party/eris/ltm.h Examining src/third_party/eris/ltable.h Examining src/third_party/eris/lauxlib.h Examining src/third_party/eris/eris.c Examining src/third_party/eris/lutf8lib.c Examining src/third_party/eris/lua.c Examining src/third_party/eris/ltablib.c Examining src/third_party/eris/lualib.h Examining src/third_party/eris/luac.c Examining src/third_party/eris/lundump.h Examining src/third_party/eris/lvm.c Examining src/third_party/eris/ldebug.c Examining src/third_party/eris/lfunc.c Examining src/third_party/eris/loadlib.c Examining src/third_party/eris/loslib.c Examining src/third_party/eris/lmem.h Examining src/third_party/eris/lopcodes.h Examining src/third_party/eris/ltable.c Examining src/third_party/eris/lbaselib.c Examining src/third_party/eris/lobject.h Examining src/third_party/eris/lctype.c Examining src/third_party/eris/lcorolib.c Examining src/third_party/eris/lvm.h Examining src/third_party/eris/llex.c Examining src/third_party/eris/lua.h Examining src/third_party/eris/lprefix.h Examining src/third_party/eris/lparser.c Examining src/third_party/eris/lauxlib.c Examining src/third_party/eris/lstring.h Examining src/third_party/eris/lstate.h Examining src/third_party/eris/lapi.h Examining src/third_party/eris/lua.hpp Examining src/third_party/eris/lbitlib.c Examining src/third_party/eris/ldo.h Examining src/third_party/eris/ldebug.h Examining src/third_party/eris/lgc.h Examining src/third_party/eris/lundump.c Examining src/third_party/eris/llex.h Examining src/third_party/eris/ldblib.c Examining src/third_party/eris/lstrlib.c Examining src/third_party/eris/ltm.c Examining src/third_party/eris/ldump.c Examining src/third_party/eris/lstring.c Examining src/third_party/eris/lfunc.h Examining src/third_party/eris/liolib.c Examining src/third_party/eris/ldo.c Examining src/third_party/eris/lopcodes.c Examining src/third_party/eris/lcode.c Examining src/third_party/eris/eris.h Examining src/third_party/eris/lmathlib.c Examining src/third_party/eris/lobject.c Examining src/third_party/eris/lzio.h Examining src/third_party/eris/lgc.c Examining src/third_party/eris/lstate.c Examining src/third_party/eris/linit.c Examining src/third_party/eris/lparser.h Examining src/third_party/eris/lzio.c Examining src/third_party/eris/llimits.h Examining src/third_party/eris/luaconf.h Examining src/third_party/minizip/zip.h Examining src/third_party/minizip/unzip.cc Examining src/third_party/minizip/ioapi.h Examining src/third_party/minizip/unzip.h Examining src/ui_fsmenu/launch_mpg.h Examining src/ui_fsmenu/campaign_select.cc Examining src/ui_fsmenu/multiplayer.cc Examining src/ui_fsmenu/main_menu.cc Examining src/ui_fsmenu/main_menu.h Examining src/ui_fsmenu/loadgame.h Examining src/ui_fsmenu/intro.cc Examining src/ui_fsmenu/intro.h Examining src/ui_fsmenu/singleplayer.h Examining src/ui_fsmenu/base.cc Examining src/ui_fsmenu/netsetup_lan.h Examining src/ui_fsmenu/options.h Examining src/ui_fsmenu/internet_lobby.cc Examining src/ui_fsmenu/helpwindow.h Examining src/ui_fsmenu/options.cc Examining src/ui_fsmenu/launch_spg.h Examining src/ui_fsmenu/launch_mpg.cc Examining src/ui_fsmenu/launch_game.cc Examining src/ui_fsmenu/mapselect.cc Examining src/ui_fsmenu/load_map_or_game.h Examining src/ui_fsmenu/multiplayer.h Examining src/ui_fsmenu/main.cc Examining src/ui_fsmenu/load_map_or_game.cc Examining src/ui_fsmenu/base.h Examining src/ui_fsmenu/about.h Examining src/ui_fsmenu/helpwindow.cc Examining src/ui_fsmenu/mapselect.h Examining src/ui_fsmenu/internet_lobby.h Examining src/ui_fsmenu/netsetup_lan.cc Examining src/ui_fsmenu/about.cc Examining src/ui_fsmenu/launch_game.h Examining src/ui_fsmenu/singleplayer.cc Examining src/ui_fsmenu/campaign_select.h Examining src/ui_fsmenu/main.h Examining src/ui_fsmenu/launch_spg.cc Examining src/ui_fsmenu/loadgame.cc Examining src/io/filewrite.h Examining src/io/streamread.cc Examining src/io/filesystem/zip_filesystem.h Examining src/io/filesystem/disk_filesystem.cc Examining src/io/filesystem/filesystem.cc Examining src/io/filesystem/test/filesystem_test_main.cc Examining src/io/filesystem/test/test_filesystem.cc Examining src/io/filesystem/zip_filesystem.cc Examining src/io/filesystem/filesystem.h Examining src/io/filesystem/disk_filesystem.h Examining src/io/filesystem/layered_filesystem.h Examining src/io/filesystem/zip_exceptions.h Examining src/io/filesystem/filesystem_exceptions.h Examining src/io/filesystem/layered_filesystem.cc Examining src/io/streamwrite.cc Examining src/io/fileread.cc Examining src/io/streamwrite.h Examining src/io/fileread.h Examining src/io/streamread.h Examining src/io/machdep.h Examining src/io/filewrite.cc Examining src/economy/fleet.h Examining src/economy/warehousesupply.h Examining src/economy/shippingitem.cc Examining src/economy/router.cc Examining src/economy/economy.h Examining src/economy/expedition_bootstrap.cc Examining src/economy/router.h Examining src/economy/road.h Examining src/economy/route.h Examining src/economy/request.cc Examining src/economy/routeastar.h Examining src/economy/cmd_call_economy_balance.h Examining src/economy/portdock.cc Examining src/economy/economy_data_packet.h Examining src/economy/flag.h Examining src/economy/flag.cc Examining src/economy/expedition_bootstrap.h Examining src/economy/fleet.cc Examining src/economy/idleworkersupply.h Examining src/economy/economy.cc Examining src/economy/workers_queue.h Examining src/economy/transfer.h Examining src/economy/supply_list.h Examining src/economy/cmd_call_economy_balance.cc Examining src/economy/test/economy_test_main.cc Examining src/economy/test/test_road.cc Examining src/economy/test/test_routing.cc Examining src/economy/shippingitem.h Examining src/economy/route.cc Examining src/economy/input_queue.h Examining src/economy/road.cc Examining src/economy/itransport_cost_calculator.h Examining src/economy/trackptr.h Examining src/economy/ware_instance.h Examining src/economy/request.h Examining src/economy/portdock.h Examining src/economy/supply_list.cc Examining src/economy/routeastar.cc Examining src/economy/transfer.cc Examining src/economy/routing_node.h Examining src/economy/workers_queue.cc Examining src/economy/wares_queue.cc Examining src/economy/input_queue.cc Examining src/economy/ware_instance.cc Examining src/economy/economy_data_packet.cc Examining src/economy/supply.h Examining src/economy/idleworkersupply.cc Examining src/economy/wares_queue.h Examining src/economy/iroute.h Examining src/sound/note_sound.h Examining src/sound/sound_handler.cc Examining src/sound/sound_handler.h Examining src/sound/fxset.h Examining src/sound/songset.h Examining src/sound/note_sound.cc Examining src/sound/songset.cc Examining src/sound/fxset.cc Examining src/wlapplication.h Examining src/random/random.h Examining src/random/random.cc Examining src/ui_basic/tabpanel.h Examining src/ui_basic/panel.h Examining src/ui_basic/box.cc Examining src/ui_basic/fullscreen_window.h Examining src/ui_basic/dropdown.h Examining src/ui_basic/icongrid.cc Examining src/ui_basic/multilinetextarea.h Examining src/ui_basic/icon.h Examining src/ui_basic/icon.cc Examining src/ui_basic/multilineeditbox.h Examining src/ui_basic/scrollbar.h Examining src/ui_basic/progresswindow.cc Examining src/ui_basic/button.h Examining src/ui_basic/progressbar.cc Examining src/ui_basic/radiobutton.h Examining src/ui_basic/messagebox.h Examining src/ui_basic/button.cc Examining src/ui_basic/unique_window.h Examining src/ui_basic/progresswindow.h Examining src/ui_basic/table.cc Examining src/ui_basic/textarea.cc Examining src/ui_basic/progressbar.h Examining src/ui_basic/editbox.h Examining src/ui_basic/multilineeditbox.cc Examining src/ui_basic/spinbox.h Examining src/ui_basic/multilinetextarea.cc Examining src/ui_basic/panel.cc Examining src/ui_basic/table.h Examining src/ui_basic/slider.h Examining src/ui_basic/unique_window.cc Examining src/ui_basic/icongrid.h Examining src/ui_basic/listselect.h Examining src/ui_basic/slider.cc Examining src/ui_basic/editbox.cc Examining src/ui_basic/listselect.cc Examining src/ui_basic/checkbox.cc Examining src/ui_basic/tabpanel.cc Examining src/ui_basic/dropdown.cc Examining src/ui_basic/mouse_constants.h Examining src/ui_basic/messagebox.cc Examining src/ui_basic/window.h Examining src/ui_basic/fileview_panel.h Examining src/ui_basic/spinbox.cc Examining src/ui_basic/checkbox.h Examining src/ui_basic/scrollbar.cc Examining src/ui_basic/textarea.h Examining src/ui_basic/window.cc Examining src/ui_basic/fileview_panel.cc Examining src/ui_basic/radiobutton.cc Examining src/ui_basic/fullscreen_window.cc Examining src/ui_basic/box.h Examining src/logic/game_data_error.h Examining src/logic/cmd_delete_message.h Examining src/logic/findimmovable.cc Examining src/logic/mapastar.cc Examining src/logic/widelands_geometry.cc Examining src/logic/cookie_priority_queue.h Examining src/logic/player.cc Examining src/logic/single_player_game_settings_provider.cc Examining src/logic/cmd_queue.h Examining src/logic/cmd_delete_message.cc Examining src/logic/campaign_visibility.cc Examining src/logic/constants.h Examining src/logic/queue_cmd_factory.h Examining src/logic/findnode.h Examining src/logic/mapregion.h Examining src/logic/widelands_geometry_io.h Examining src/logic/roadtype.h Examining src/logic/ai_dna_handler.cc Examining src/logic/cmd_incorporate.cc Examining src/logic/editor_game_base.h Examining src/logic/field.h Examining src/logic/mapfringeregion.cc Examining src/logic/objective.h Examining src/logic/single_player_game_settings_provider.h Examining src/logic/cmd_incorporate.h Examining src/logic/message_queue.h Examining src/logic/maphollowregion.h Examining src/logic/playersmanager.cc Examining src/logic/ai_dna_handler.h Examining src/logic/game_data_error.cc Examining src/logic/cmd_calculate_statistics.cc Examining src/logic/playercommand.cc Examining src/logic/field.cc Examining src/logic/replay_game_controller.h Examining src/logic/maptriangleregion.h Examining src/logic/game.h Examining src/logic/save_handler.h Examining src/logic/game.cc Examining src/logic/message.h Examining src/logic/save_handler.cc Examining src/logic/queue_cmd_ids.h Examining src/logic/constants.cc Examining src/logic/map.cc Examining src/logic/cmd_luascript.h Examining src/logic/campaign_visibility.h Examining src/logic/game_settings.h Examining src/logic/single_player_game_controller.cc Examining src/logic/message_id.h Examining src/logic/map.h Examining src/logic/replay.h Examining src/logic/mapdifferenceregion.h Examining src/logic/replay.cc Examining src/logic/mapdifferenceregion.cc Examining src/logic/player_end_result.h Examining src/logic/backtrace.cc Examining src/logic/replay_game_controller.cc Examining src/logic/findimmovable.h Examining src/logic/path.h Examining src/logic/player_area.h Examining src/logic/widelands_geometry_io.cc Examining src/logic/editor_game_base.cc Examining src/logic/player.h Examining src/logic/map_revision.h Examining src/logic/maphollowregion.cc Examining src/logic/backtrace.h Examining src/logic/mapastar.h Examining src/logic/playersmanager.h Examining src/logic/widelands.h Examining src/logic/findbob.h Examining src/logic/findnode.cc Examining src/logic/description_maintainer.h Examining src/logic/findbob.cc Examining src/logic/cmd_luacoroutine.cc Examining src/logic/maptriangleregion.cc Examining src/logic/cmd_luascript.cc Examining src/logic/cmd_queue.cc Examining src/logic/single_player_game_controller.h Examining src/logic/widelands_geometry.h Examining src/logic/pathfield.h Examining src/logic/cmd_luacoroutine.h Examining src/logic/game_controller.h Examining src/logic/cmd_calculate_statistics.h Examining src/logic/queue_cmd_factory.cc Examining src/logic/mapfringeregion.h Examining src/logic/nodecaps.h Examining src/logic/map_objects/buildcost.h Examining src/logic/map_objects/bob.cc Examining src/logic/map_objects/immovable.cc Examining src/logic/map_objects/buildcost.cc Examining src/logic/map_objects/checkstep.cc Examining src/logic/map_objects/map_object.h Examining src/logic/map_objects/world/editor_category.h Examining src/logic/map_objects/world/critter_program.h Examining src/logic/map_objects/world/map_gen.h Examining src/logic/map_objects/world/terrain_description.cc Examining src/logic/map_objects/world/editor_category.cc Examining src/logic/map_objects/world/map_gen.cc Examining src/logic/map_objects/world/world.h Examining src/logic/map_objects/world/terrain_description.h Examining src/logic/map_objects/world/critter.cc Examining src/logic/map_objects/world/resource_description.cc Examining src/logic/map_objects/world/resource_description.h Examining src/logic/map_objects/world/world.cc Examining src/logic/map_objects/world/critter.h Examining src/logic/map_objects/terrain_affinity.cc Examining src/logic/map_objects/bob.h Examining src/logic/map_objects/terrain_affinity.h Examining src/logic/map_objects/map_object.cc Examining src/logic/map_objects/immovable.h Examining src/logic/map_objects/walkingdir.cc Examining src/logic/map_objects/checkstep.h Examining src/logic/map_objects/draw_text.h Examining src/logic/map_objects/walkingdir.h Examining src/logic/map_objects/tribes/productionsite.h Examining src/logic/map_objects/tribes/ship.cc Examining src/logic/map_objects/tribes/training_attribute.h Examining src/logic/map_objects/tribes/building.h Examining src/logic/map_objects/tribes/productionsite.cc Examining src/logic/map_objects/tribes/tribe_descr.cc Examining src/logic/map_objects/tribes/attack_target.h Examining src/logic/map_objects/tribes/road_textures.h Examining src/logic/map_objects/tribes/program_result.h Examining src/logic/map_objects/tribes/worker_program.cc Examining src/logic/map_objects/tribes/militarysite.h Examining src/logic/map_objects/tribes/constructionsite.cc Examining src/logic/map_objects/tribes/warelist.h Examining src/logic/map_objects/tribes/battle.cc Examining src/logic/map_objects/tribes/carrier.h Examining src/logic/map_objects/tribes/dismantlesite.h Examining src/logic/map_objects/tribes/workarea_info.h Examining src/logic/map_objects/tribes/tribes.h Examining src/logic/map_objects/tribes/production_program.cc Examining src/logic/map_objects/tribes/worker_program.h Examining src/logic/map_objects/tribes/tribe_descr.h Examining src/logic/map_objects/tribes/tribe_basic_info.h Examining src/logic/map_objects/tribes/wareworker.h Examining src/logic/map_objects/tribes/militarysite.cc Examining src/logic/map_objects/tribes/worker.h Examining src/logic/map_objects/tribes/soldier.h Examining src/logic/map_objects/tribes/soldier.cc Examining src/logic/map_objects/tribes/partially_finished_building.h Examining src/logic/map_objects/tribes/requirements.cc Examining src/logic/map_objects/tribes/road_textures.cc Examining src/logic/map_objects/tribes/warelist.cc Examining src/logic/map_objects/tribes/warehouse.h Examining src/logic/map_objects/tribes/tribes.cc Examining src/logic/map_objects/tribes/ware_descr.cc Examining src/logic/map_objects/tribes/worker_descr.h Examining src/logic/map_objects/tribes/building.cc Examining src/logic/map_objects/tribes/worker_descr.cc Examining src/logic/map_objects/tribes/ware_descr.h Examining src/logic/map_objects/tribes/trainingsite.cc Examining src/logic/map_objects/tribes/production_program.h Examining src/logic/map_objects/tribes/soldiercontrol.h Examining src/logic/map_objects/tribes/trainingsite.h Examining src/logic/map_objects/tribes/warehouse.cc Examining src/logic/map_objects/tribes/bill_of_materials.h Examining src/logic/map_objects/tribes/battle.h Examining src/logic/map_objects/tribes/carrier.cc Examining src/logic/map_objects/tribes/dismantlesite.cc Examining src/logic/map_objects/tribes/ship.h Examining src/logic/map_objects/tribes/partially_finished_building.cc Examining src/logic/map_objects/tribes/requirements.h Examining src/logic/map_objects/tribes/constructionsite.h Examining src/logic/map_objects/tribes/tribe_basic_info.cc Examining src/logic/map_objects/tribes/worker.cc Examining src/logic/map_objects/immovable_program.h Examining src/logic/map_revision.cc Examining src/logic/path.cc Examining src/logic/playercommand.h Examining src/logic/pathfield.cc Examining src/logic/game_settings.cc Examining src/graphic/game_renderer.cc Examining src/graphic/rendertarget.cc Examining src/graphic/image_io.cc Examining src/graphic/align.cc Examining src/graphic/text_parser.cc Examining src/graphic/animation.h Examining src/graphic/build_texture_atlas.cc Examining src/graphic/rendertarget.h Examining src/graphic/image.h Examining src/graphic/surface.cc Examining src/graphic/font.cc Examining src/graphic/minimap_renderer.h Examining src/graphic/minimap_renderer.cc Examining src/graphic/font_handler1.cc Examining src/graphic/playercolor.cc Examining src/graphic/image_cache.cc Examining src/graphic/wordwrap.h Examining src/graphic/richtext.cc Examining src/graphic/default_resolution.h Examining src/graphic/blend_mode.h Examining src/graphic/texture_atlas.cc Examining src/graphic/text_layout.h Examining src/graphic/sdl_utils.cc Examining src/graphic/screen.cc Examining src/graphic/text_constants.h Examining src/graphic/texture_atlas.h Examining src/graphic/image_cache.h Examining src/graphic/text_parser.h Examining src/graphic/text/rendered_text.h Examining src/graphic/text/rt_render.h Examining src/graphic/text/textstream.h Examining src/graphic/text/font_set.h Examining src/graphic/text/rendered_text.cc Examining src/graphic/text/rt_errors.h Examining src/graphic/text/transient_cache.h Examining src/graphic/text/font_io.cc Examining src/graphic/text/sdl_ttf_font.h Examining src/graphic/text/rt_parse.h Examining src/graphic/text/rt_errors_impl.h Examining src/graphic/text/test/render_richtext.cc Examining src/graphic/text/test/render.cc Examining src/graphic/text/test/render.h Examining src/graphic/text/bidi.cc Examining src/graphic/text/rt_parse.cc Examining src/graphic/text/rt_render.cc Examining src/graphic/text/bidi.h Examining src/graphic/text/sdl_ttf_font.cc Examining src/graphic/text/textstream.cc Examining src/graphic/text/font_io.h Examining src/graphic/text/texture_cache.h Examining src/graphic/text/font_set.cc Examining src/graphic/animation.cc Examining src/graphic/gl/road_program.cc Examining src/graphic/gl/terrain_program.cc Examining src/graphic/gl/blit_data.h Examining src/graphic/gl/fill_rect_program.cc Examining src/graphic/gl/fields_to_draw.h Examining src/graphic/gl/utils.cc Examining src/graphic/gl/fill_rect_program.h Examining src/graphic/gl/dither_program.h Examining src/graphic/gl/blit_program.cc Examining src/graphic/gl/initialize.h Examining src/graphic/gl/initialize.cc Examining src/graphic/gl/system_headers.h Examining src/graphic/gl/utils.h Examining src/graphic/gl/dither_program.cc Examining src/graphic/gl/road_program.h Examining src/graphic/gl/blit_program.h Examining src/graphic/gl/draw_line_program.h Examining src/graphic/gl/coordinate_conversion.h Examining src/graphic/gl/terrain_program.h Examining src/graphic/gl/draw_line_program.cc Examining src/graphic/font_handler.cc Examining src/graphic/font.h Examining src/graphic/font_handler1.h Examining src/graphic/texture.cc Examining src/graphic/align.h Examining src/graphic/game_renderer.h Examining src/graphic/image_io.h Examining src/graphic/playercolor.h Examining src/graphic/render_queue.cc Examining src/graphic/surface.h Examining src/graphic/diranimations.h Examining src/graphic/color.h Examining src/graphic/texture.h Examining src/graphic/blit_mode.h Examining src/graphic/build_texture_atlas.h Examining src/graphic/text_constants.cc Examining src/graphic/richtext.h Examining src/graphic/graphic.cc Examining src/graphic/screen.h Examining src/graphic/graphic.h Examining src/graphic/color.cc Examining src/graphic/font_handler.h Examining src/graphic/sdl_utils.h Examining src/graphic/render_queue.h Examining src/graphic/text_layout.cc Examining src/graphic/wordwrap.cc Examining src/base/md5.h Examining src/base/wexception.h Examining src/base/i18n.h Examining src/base/md5.cc Examining src/base/scoped_timer.h Examining src/base/utf8.cc Examining src/base/time_string.h Examining src/base/warning.h Examining src/base/math.h Examining src/base/utf8.h Examining src/base/rect.h Examining src/base/time_string.cc Examining src/base/macros.h Examining src/base/math.cc Examining src/base/scoped_timer.cc Examining src/base/vector.h Examining src/base/exceptions.cc Examining src/base/vector.cc Examining src/base/i18n.cc Examining src/base/log.cc Examining src/base/log.h Examining src/base/macros.cc Examining src/main.cc Examining src/game_io/game_class_packet.h Examining src/game_io/game_cmd_queue_packet.cc Examining src/game_io/game_player_ai_persistent_packet.h Examining src/game_io/game_player_info_packet.h Examining src/game_io/game_interactive_player_packet.cc Examining src/game_io/game_saver.h Examining src/game_io/game_map_packet.cc Examining src/game_io/game_cmd_queue_packet.h Examining src/game_io/game_player_info_packet.cc Examining src/game_io/game_preload_packet.h Examining src/game_io/game_player_ai_persistent_packet.cc Examining src/game_io/game_saver.cc Examining src/game_io/game_player_economies_packet.cc Examining src/game_io/game_loader.cc Examining src/game_io/game_player_economies_packet.h Examining src/game_io/game_map_packet.h Examining src/game_io/game_interactive_player_packet.h Examining src/game_io/game_data_packet.h Examining src/game_io/game_class_packet.cc Examining src/game_io/game_preload_packet.cc Examining src/game_io/game_loader.h Examining src/ai/ai_help_structs.cc Examining src/ai/ai_help_structs.h Examining src/ai/defaultai_seafaring.cc Examining src/ai/defaultai.cc Examining src/ai/defaultai_warfare.cc Examining src/ai/ai_hints.cc Examining src/ai/computer_player.h Examining src/ai/computer_player.cc Examining src/ai/ai_hints.h Examining src/ai/defaultai.h Examining src/wui/plot_area.h Examining src/wui/chat_msg_layout.h Examining src/wui/unique_window_handler.cc Examining src/wui/militarysitewindow.cc Examining src/wui/dismantlesitewindow.h Examining src/wui/productionsitewindow.cc Examining src/wui/gamechatpanel.cc Examining src/wui/logmessage.h Examining src/wui/tribal_encyclopedia.h Examining src/wui/minimap.h Examining src/wui/game_objectives_menu.cc Examining src/wui/playerdescrgroup.h Examining src/wui/interactive_gamebase.h Examining src/wui/encyclopedia_window.cc Examining src/wui/mapview.cc Examining src/wui/gamechatpanel.h Examining src/wui/economy_options_window.h Examining src/wui/game_debug_ui.cc Examining src/wui/login_box.cc Examining src/wui/game_main_menu_save_game.h Examining src/wui/mapdetails.cc Examining src/wui/general_statistics_menu.cc Examining src/wui/warehousewindow.h Examining src/wui/game_options_menu.h Examining src/wui/shipwindow.cc Examining src/wui/chat_msg_layout.cc Examining src/wui/waresdisplay.cc Examining src/wui/game_message_menu.h Examining src/wui/tribal_encyclopedia.cc Examining src/wui/maptable.h Examining src/wui/inputqueuedisplay.cc Examining src/wui/mapdetails.h Examining src/wui/map_tags.cc Examining src/wui/game_tips.cc Examining src/wui/soldierlist.h Examining src/wui/login_box.h Examining src/wui/economy_options_window.cc Examining src/wui/interactive_base.h Examining src/wui/interactive_player.h Examining src/wui/dismantlesitewindow.cc Examining src/wui/trainingsitewindow.h Examining src/wui/multiplayersetupgroup.h Examining src/wui/interactive_gamebase.cc Examining src/wui/productionsitewindow.h Examining src/wui/quicknavigation.cc Examining src/wui/interactive_spectator.h Examining src/wui/stock_menu.cc Examining src/wui/general_statistics_menu.h Examining src/wui/game_statistics_menu.cc Examining src/wui/militarysitewindow.h Examining src/wui/building_statistics_menu.h Examining src/wui/chatoverlay.h Examining src/wui/helpwindow.h Examining src/wui/chatoverlay.cc Examining src/wui/portdockwaresdisplay.h Examining src/wui/buildingwindow.cc Examining src/wui/quicknavigation.h Examining src/wui/watchwindow.cc Examining src/wui/encyclopedia_window.h Examining src/wui/game_options_sound_menu.h Examining src/wui/transport_draw.cc Examining src/wui/interactive_base.cc Examining src/wui/inputqueuedisplay.h Examining src/wui/game_chat_menu.cc Examining src/wui/attack_box.cc Examining src/wui/game_summary.cc Examining src/wui/suggested_teams_box.h Examining src/wui/interactive_player.cc Examining src/wui/itemwaresdisplay.h Examining src/wui/unique_window_handler.h Examining src/wui/interactive_spectator.cc Examining src/wui/portdockwaresdisplay.cc Examining src/wui/game_summary.h Examining src/wui/actionconfirm.h Examining src/wui/game_chat_menu.h Examining src/wui/field_overlay_manager.cc Examining src/wui/game_tips.h Examining src/wui/edge_overlay_manager.cc Examining src/wui/stock_menu.h Examining src/wui/mapdata.h Examining src/wui/maptable.cc Examining src/wui/story_message_box.cc Examining src/wui/constructionsitewindow.h Examining src/wui/multiplayersetupgroup.cc Examining src/wui/game_main_menu_save_game.cc Examining src/wui/helpwindow.cc Examining src/wui/ware_statistics_menu.cc Examining src/wui/game_options_sound_menu.cc Examining src/wui/game_debug_ui.h Examining src/wui/trainingsitewindow.cc Examining src/wui/fieldaction.h Examining src/wui/attack_box.h Examining src/wui/mapdata.cc Examining src/wui/buildingwindow.h Examining src/wui/actionconfirm.cc Examining src/wui/debugconsole.cc Examining src/wui/plot_area.cc Examining src/wui/constructionsitewindow.cc Examining src/wui/soldierlist.cc Examining src/wui/warehousewindow.cc Examining src/wui/map_tags.h Examining src/wui/mapviewpixelfunctions.cc Examining src/wui/suggested_teams_box.cc Examining src/wui/soldiercapacitycontrol.cc Examining src/wui/game_objectives_menu.h Examining src/wui/game_statistics_menu.h Examining src/wui/fieldaction.cc Examining src/wui/playerdescrgroup.cc Examining src/wui/game_options_menu.cc Examining src/wui/field_overlay_manager.h Examining src/wui/minimap.cc Examining src/wui/soldiercapacitycontrol.h Examining src/wui/edge_overlay_manager.h Examining src/wui/waresdisplay.h Examining src/wui/mapviewpixelfunctions.h Examining src/wui/story_message_box.h Examining src/wui/building_statistics_menu.cc Examining src/wui/watchwindow.h Examining src/wui/mapviewpixelconstants.h Examining src/wui/game_message_menu.cc Examining src/wui/itemwaresdisplay.cc Examining src/wui/ware_statistics_menu.h Examining src/wui/shipwindow.h Examining src/wui/mapview.h Examining src/wui/debugconsole.h Examining src/wlapplication_messages.cc Examining src/wlapplication.cc Examining src/build_info.h Examining src/chat/chat.h Examining src/chat/chat.cc Examining src/profile/profile.h Examining src/profile/profile.cc Examining src/helper.h Examining src/scripting/lua_root.cc Examining src/scripting/lua_coroutine.cc Examining src/scripting/globals.cc Examining src/scripting/lua_interface.h Examining src/scripting/lua_globals.cc Examining src/scripting/luna_impl.cc Examining src/scripting/globals.h Examining src/scripting/lua_bases.cc Examining src/scripting/run_script.cc Examining src/scripting/report_error.cc Examining src/scripting/lua_map.cc Examining src/scripting/lua_globals.h Examining src/scripting/factory.cc Examining src/scripting/lua_path.h Examining src/scripting/luna.h Examining src/scripting/luna_impl.h Examining src/scripting/lua.h Examining src/scripting/lua_ui.h Examining src/scripting/lua_game.h Examining src/scripting/lua_game.cc Examining src/scripting/report_error.h Examining src/scripting/lua_table.h Examining src/scripting/test/scripting_test_main.cc Examining src/scripting/test/test_luna.cc Examining src/scripting/lua_table.cc Examining src/scripting/lua_root.h Examining src/scripting/lua_errors.cc Examining src/scripting/lua_editor.cc Examining src/scripting/persistence.h Examining src/scripting/lua_editor.h Examining src/scripting/lua_errors.h Examining src/scripting/run_script.h Examining src/scripting/lua_coroutine.h Examining src/scripting/lua_bases.h Examining src/scripting/lua.cc Examining src/scripting/logic.h Examining src/scripting/lua_path.cc Examining src/scripting/persistence.cc Examining src/scripting/lua_ui.cc Examining src/scripting/eris.h Examining src/scripting/factory.h Examining src/scripting/lua_interface.cc Examining src/scripting/logic.cc Examining src/scripting/lua_map.h Examining src/network/internet_gaming_messages.cc Examining src/network/network_lan_promotion.cc Examining src/network/internet_gaming_messages.h Examining src/network/gamehost.h Examining src/network/network_gaming_messages.cc Examining src/network/constants.h Examining src/network/network_lan_promotion.h Examining src/network/network_protocol.h Examining src/network/internet_gaming.cc Examining src/network/gamehost.cc Examining src/network/nethost.h Examining src/network/network.h Examining src/network/nethost.cc Examining src/network/network_player_settings_backend.cc Examining src/network/network_gaming_messages.h Examining src/network/network_player_settings_backend.h Examining src/network/netclient.h Examining src/network/gameclient.cc Examining src/network/network.cc Examining src/network/internet_gaming.h Examining src/network/gameclient.h Examining src/network/netclient.cc Examining src/network/internet_gaming_protocol.h Examining src/website/map_info.cc Examining src/website/map_object_info.cc Examining src/map_io/map_flagdata_packet.cc Examining src/map_io/map_object_packet.cc Examining src/map_io/map_players_messages_packet.cc Examining src/map_io/map_flag_packet.cc Examining src/map_io/map_images.cc Examining src/map_io/map_heights_packet.h Examining src/map_io/map_flagdata_packet.h Examining src/map_io/map_roaddata_packet.h Examining src/map_io/map_terrain_packet.cc Examining src/map_io/widelands_map_loader.cc Examining src/map_io/map_loader.h Examining src/map_io/map_port_spaces_packet.cc Examining src/map_io/tribes_legacy_lookup_table.cc Examining src/map_io/map_objective_packet.cc Examining src/map_io/map_object_loader.cc Examining src/map_io/map_heights_packet.cc Examining src/map_io/map_road_packet.h Examining src/map_io/map_object_loader.h Examining src/map_io/map_object_saver.h Examining src/map_io/map_resources_packet.cc Examining src/map_io/map_road_packet.cc Examining src/map_io/map_exploration_packet.h Examining src/map_io/map_terrain_packet.h Examining src/map_io/map_allowed_worker_types_packet.cc Examining src/map_io/s2map.h Examining src/map_io/map_building_packet.cc Examining src/map_io/map_object_packet.h Examining src/map_io/map_players_view_packet.h Examining src/map_io/map_allowed_building_types_packet.h Examining src/map_io/map_node_ownership_packet.h Examining src/map_io/map_resources_packet.h Examining src/map_io/map_players_messages_packet.h Examining src/map_io/tribes_legacy_lookup_table.h Examining src/map_io/map_node_ownership_packet.cc Examining src/map_io/map_version_packet.h Examining src/map_io/world_legacy_lookup_table.cc Examining src/map_io/map_allowed_building_types_packet.cc Examining src/map_io/map_scripting_packet.h Examining src/map_io/map_scripting_packet.cc Examining src/map_io/map_bob_packet.cc Examining src/map_io/map_player_position_packet.cc Examining src/map_io/map_elemental_packet.cc Examining src/map_io/map_buildingdata_packet.h Examining src/map_io/widelands_map_loader.h Examining src/map_io/map_objective_packet.h Examining src/map_io/s2map.cc Examining src/map_io/map_saver.h Examining src/map_io/map_bob_packet.h Examining src/map_io/map_saver.cc Examining src/map_io/map_flag_packet.h Examining src/map_io/map_object_saver.cc Examining src/map_io/map_exploration_packet.cc Examining src/map_io/coords_profile.h Examining src/map_io/map_elemental_packet.h Examining src/map_io/map_message_saver.h Examining src/map_io/world_legacy_lookup_table.h Examining src/map_io/map_buildingdata_packet.cc Examining src/map_io/map_roaddata_packet.cc Examining src/map_io/map_player_position_packet.h Examining src/map_io/coords_profile.cc Examining src/map_io/map_player_names_and_tribes_packet.h Examining src/map_io/map_port_spaces_packet.h Examining src/map_io/map_player_names_and_tribes_packet.cc Examining src/map_io/map_allowed_worker_types_packet.h Examining src/map_io/map_images.h Examining src/map_io/map_data_packet.h Examining src/map_io/map_version_packet.cc Examining src/map_io/map_building_packet.h Examining src/map_io/map_players_view_packet.cc FINAL RESULTS: src/wlapplication.cc:137: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. size_t size = readlink("/proc/self/exe", buffer, PATH_MAX); src/base/exceptions.cc:36: [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. vsnprintf(buffer, sizeof(buffer), fmt, va); src/base/exceptions.cc:56: [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. vsnprintf(buffer, sizeof(buffer), em, va); src/base/log.cc:126: [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. vsnprintf(buffer, sizeof(buffer), fmt, va); src/economy/transfer.cc:257: [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. vsnprintf(buffer, sizeof(buffer), fmt, va); src/io/streamread.cc:37: [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. vsnprintf(buffer, sizeof(buffer), fmt, va); src/io/streamwrite.cc:41: [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. int32_t i = vsnprintf(buffer, sizeof(buffer), fmt, va); src/io/streamwrite.cc:60: [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. i = vsnprintf(heapbuf, i + 1, fmt, va); src/logic/game_data_error.cc:36: [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. vsnprintf(buffer, sizeof(buffer), fmt, va); src/logic/map_objects/map_object.cc:532: [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. vsnprintf(buffer, sizeof(buffer), fmt, va); src/map_io/map_players_view_packet.cc:119: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(filename, sizeof(filename), filename_template, plnum, version); \ src/map_io/map_players_view_packet.cc:136: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(filename, sizeof(filename), filename_template, plnum, fileversion); \ src/map_io/map_players_view_packet.cc:154: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(filename, sizeof(filename), file_templ, plnum, fileversion); \ src/map_io/map_players_view_packet.cc:300: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(unseen_times_filename, sizeof(unseen_times_filename), UNSEEN_TIMES_FILENAME_TEMPLATE, src/map_io/map_players_view_packet.cc:398: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf( src/map_io/map_players_view_packet.cc:833: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(filename, sizeof(filename), filename_template, plnum, version); \ src/network/network.cc:247: [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. vsnprintf(buffer, sizeof(buffer), fmt, va); src/profile/profile.cc:510: [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. vsnprintf(buffer, sizeof(buffer), fmt, va); src/scripting/report_error.cc:35: [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. vsnprintf(buffer, sizeof(buffer), fmt, va); src/third_party/eris/lauxlib.h:194: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define lua_writestringerror(s, p) (fprintf(stderr, (s), (p)), fflush(stderr)) src/third_party/eris/liolib.c:58: [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)) src/third_party/eris/liolib.c:618: [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)) src/third_party/eris/liolib.c:619: [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)); src/third_party/eris/loslib.c:111: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination (CWE-120). Consider using strcpy_s, strncpy, or strlcpy (warning, strncpy is easily misused). strcpy(b, LUA_TMPNAMTEMPLATE); \ src/third_party/eris/loslib.c:132: [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); src/third_party/eris/lstrlib.c:978: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination (CWE-120). Consider using strcpy_s, strncpy, or strlcpy (warning, strncpy is easily misused). strcpy(form + l - 1, lenmod); src/third_party/eris/luac.c:263: [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"); src/third_party/eris/luac.c:268: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buff,LUA_NUMBER_FMT,fltvalue(o)); src/third_party/eris/luac.c:274: [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)); src/third_party/eris/luaconf.h:553: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define l_sprintf(s, sz, f, i) snprintf(s, sz, f, i) src/third_party/eris/luaconf.h:555: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define l_sprintf(s, sz, f, i) ((void)(sz), sprintf(s, f, i)) src/base/i18n.cc:140: [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. lang = getenv("LANG"); src/base/i18n.cc:145: [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. lang = getenv("LANGUAGE"); src/io/filesystem/filesystem.cc:162: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. homedir = getenv(name); \ src/io/filesystem/filesystem.cc:174: [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 (char const* const h = getenv("HOME")) src/third_party/eris/lmathlib.c:28: [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() src/third_party/eris/lmathlib.c:29: [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) src/third_party/eris/lmathlib.c:33: [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) src/third_party/eris/loadlib.c:687: [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); src/third_party/eris/loadlib.c:689: [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 */ src/third_party/eris/loslib.c:120: [3] (tmpfile) tmpnam: Temporary file race condition (CWE-377). #define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } src/third_party/eris/loslib.c:167: [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 */ src/third_party/eris/lua.c:534: [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); src/third_party/eris/lua.c:537: [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 */ src/wlapplication.cc:164: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. char* rp = realpath(path.c_str(), buffer); src/wlapplication.cc:359: [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. std::srand(time(nullptr)); src/base/log.cc:61: [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). stdout_.open(stdout_filename_); src/base/md5.cc:70: [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(&ctx->buffer[bytes], fillbuf, pad); src/base/md5.cc:98: [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(&ctx->buffer[left_over], buffer, add); src/base/md5.cc:104: [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(ctx->buffer, &ctx->buffer[(left_over + add) & ~63], (left_over + add) & 63); src/base/md5.cc:121: [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(ctx->buffer, buffer, len); src/game_io/game_class_packet.cc:34: [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). fr.open(fs, "binary/game_class"); src/game_io/game_cmd_queue_packet.cc:37: [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). fr.open(fs, "binary/cmd_queue"); src/game_io/game_interactive_player_packet.cc:53: [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). fr.open(fs, "binary/interactive_player"); src/game_io/game_player_ai_persistent_packet.cc:39: [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). fr.open(fs, "binary/player_ai"); src/game_io/game_player_economies_packet.cc:68: [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). fr.open(fs, "binary/player_economies"); src/game_io/game_player_info_packet.cc:38: [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). fr.open(fs, "binary/player_info"); src/graphic/font.cc:64: [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). fontfile_.open(*g_fs, filename); src/graphic/gl/utils.cc:40: [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). fr.open(*g_fs, filename); src/graphic/text/font_io.cc:44: [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). fr->open(*g_fs, filename); src/graphic/text/test/render_richtext.cc: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). f.open(fn.c_str()); src/graphic/text_parser.cc:247: [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). element.set_font_size(atoi(val.c_str())); src/graphic/text_parser.cc:259: [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). element.set_line_spacing(atoi(val.c_str())); src/io/fileread.cc:31: [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). void FileRead::open(FileSystem& fs, const std::string& filename) { src/io/fileread.cc:39: [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(fs, filename); src/io/fileread.h:85: [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). void open(FileSystem& fs, const std::string& filename); src/io/filesystem/disk_filesystem.cc:86: [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* const f = fopen(fullname.c_str(), "a"); src/io/filesystem/disk_filesystem.cc:367: [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 = fopen(fullname.c_str(), "rb"); src/io/filesystem/disk_filesystem.cc:424: [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* const f = fopen(fullname.c_str(), append ? "a" : "wb"); src/io/filesystem/disk_filesystem.cc:453: [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). explicit RealFSStreamRead(const std::string& fname) : file_(fopen(fname.c_str(), "rb")) { src/io/filesystem/disk_filesystem.cc:491: [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_ = fopen(fname.c_str(), "wb"); src/io/filewrite.cc:76: [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(data_ + i, src, size); src/io/machdep.h:75: [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(&r, ptr, sizeof(r)); src/io/machdep.h:81: [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(&r, ptr, sizeof(r)); src/io/machdep.h:87: [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(&r, ptr, sizeof(r)); src/io/streamread.cc:98: [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(&rv, &x, 4); src/io/streamwrite.h:87: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&y, &x, 4); src/logic/campaign_visibility.cc:100: [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(csection, "campsect%i", i); src/logic/campaign_visibility.cc:104: [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(cvisible, "campvisi%i", i); src/logic/campaign_visibility.cc:105: [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(cnewvisi, "cnewvisi%i", i); src/logic/campaign_visibility.cc:115: [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(csection, "campsect%i", i); src/logic/campaign_visibility.cc:123: [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(csection, "campsect%i", i); src/logic/campaign_visibility.cc:128: [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(number, "%02i", imap); src/logic/campaign_visibility.cc:143: [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(number, "%02i", imap); src/logic/campaign_visibility.cc:148: [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(csection, "campsect%i", i); src/logic/map_objects/immovable.cc:827: [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). long int const value = atoi(params[i].c_str()); src/logic/map_objects/immovable.cc:1045: [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). buildtime_ = atoi(params[1].c_str()); src/logic/map_objects/immovable.cc:1046: [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). decaytime_ = atoi(params[2].c_str()); src/logic/map_objects/tribes/worker_program.cc:526: [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). act->iparam1 = atoi(cmd[1].c_str()); src/logic/map_objects/tribes/worker_program.cc:527: [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). act->iparam2 = atoi(cmd[2].c_str()); src/logic/map_objects/tribes/worker_program.cc:541: [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). atoi(cmd[3].c_str()); src/map_io/coords_profile.cc:54: [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, "%i %i", value.x, value.y); src/map_io/map_bob_packet.cc:76: [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). fr.open(fs, "binary/bob"); src/map_io/map_building_packet.cc:55: [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). fr.open(fs, "binary/building"); src/map_io/map_buildingdata_packet.cc:79: [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). fr.open(fs, "binary/building_data"); src/map_io/map_elemental_packet.cc:89: [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). PlayerNumber player_number = static_cast(atoi(player.c_str())); src/map_io/map_exploration_packet.cc:43: [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). fr.open(fs, "binary/exploration"); src/map_io/map_exploration_packet.cc:46: [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). fr.open(fs, "binary/seen_fields"); src/map_io/map_flag_packet.cc:49: [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). fr.open(fs, "binary/flag"); src/map_io/map_flagdata_packet.cc:52: [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). fr.open(fs, "binary/flag_data"); src/map_io/map_heights_packet.cc:36: [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). fr.open(fs, "binary/heights"); src/map_io/map_node_ownership_packet.cc:43: [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). fr.open(fs, "binary/node_ownership"); src/map_io/map_node_ownership_packet.cc:46: [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). fr.open(fs, "binary/owned_fields"); src/map_io/map_object_packet.cc:55: [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). fr.open(fs, "binary/mapobjects"); src/map_io/map_players_view_packet.cc:122: [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). (file).open(fs, filename); \ src/map_io/map_players_view_packet.cc:138: [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). (file).open(fs, filename); \ src/map_io/map_players_view_packet.cc:156: [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). (file).open(fs, filename); \ src/map_io/map_players_view_packet.cc:400: [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). vision_file.open(fs, fname); src/map_io/map_resources_packet.cc:40: [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). fr.open(fs, "binary/resource"); src/map_io/map_road_packet.cc:47: [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). fr.open(fs, "binary/road"); src/map_io/map_roaddata_packet.cc:53: [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). fr.open(fs, "binary/road_data"); src/map_io/map_terrain_packet.cc:42: [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). fr.open(fs, "binary/terrain"); src/map_io/s2map.cc:176: [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, fr.data(6), 6); src/map_io/s2map.cc:204: [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(section.get() + y * width, ptr, width); src/map_io/s2map.cc:353: [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). fr.open(*g_fs, filename_.c_str()); src/map_io/s2map.cc:406: [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(&header, fr.data(sizeof(header)), sizeof(header)); src/map_io/s2map.cc:435: [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). fr.open(*g_fs, filename_.c_str()); src/network/gameclient.cc:586: [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). fr.open(*g_fs, path); src/network/gameclient.cc:652: [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(fp.part, &buf[0], size); src/network/gameclient.cc:673: [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). fr.open(*g_fs, file_->filename); src/network/gamehost.cc:1110: [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). fr.open(*g_fs, mapfilename); src/network/gamehost.cc:1119: [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(fp.part, fr.data(readout), readout); src/network/internet_gaming.cc:819: [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). fr.open(*g_fs, temp); src/network/nethost.cc:210: [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). acceptor->open(endpoint.protocol()); src/network/network_lan_promotion.cc:310: [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). socket->open(version, ec); src/network/network_lan_promotion.cc:375: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination (CWE-120). Consider using strcpy_s, strncpy, or strlcpy (warning, strncpy is easily misused). Risk is low because the source is a constant string. strcpy(gameinfo.magic, "GAME"); src/profile/profile.cc:640: [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). fr.open(fs, filename); src/third_party/eris/eris.c:555: [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(&rep, &value, sizeof(float)); src/third_party/eris/eris.c:562: [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(&rep, &value, sizeof(double)); src/third_party/eris/eris.c:698: [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(&value, &rep, sizeof(float)); src/third_party/eris/eris.c:706: [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(&value, &rep, sizeof(double)); src/third_party/eris/eris.c:2366: [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, eris_buffer(buff), eris_bufflen(buff)); src/third_party/eris/eris.c:2372: [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(&eris_buffer(buff)[eris_bufflen(buff)], value, sz); src/third_party/eris/lauxlib.c:505: [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)); /* copy original content */ src/third_party/eris/lauxlib.c:517: [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)); src/third_party/eris/lauxlib.c:701: [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"); src/third_party/eris/liolib.c:244: [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); src/third_party/eris/liolib.c:256: [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); src/third_party/eris/liolib.c:282: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). p->f = tmpfile(); src/third_party/eris/loadlib.c:378: [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 */ src/third_party/eris/lobject.c:440: [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) ) src/third_party/eris/lobject.c:446: [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)); src/third_party/eris/lobject.c:454: [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)); src/third_party/eris/lobject.c:458: [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)); src/third_party/eris/lobject.c:474: [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)); src/third_party/eris/loslib.c:112: [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); \ src/third_party/eris/lstate.c:79: [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 + p, &t, sizeof(t)); p += sizeof(t); } src/third_party/eris/lstate.c:276: [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), src/third_party/eris/lstring.c:187: [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(getstr(ts), str, l * sizeof(char)); src/third_party/eris/lstring.c:207: [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(getstr(ts), str, l * sizeof(char)); src/third_party/eris/lstrlib.c:133: [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; src/third_party/eris/lstrlib.c:135: [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)); src/third_party/eris/lstrlib.c:139: [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) */ src/third_party/eris/lstrlib.c:964: [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)); src/third_party/eris/ltablib.c:259: [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, &c, sof(c) * sizeof(unsigned int)); src/third_party/eris/ltablib.c:260: [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 + sof(c), &t, sof(t) * sizeof(unsigned int)); src/third_party/eris/luac.c:181: [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"); src/third_party/eris/lvm.c:451: [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 + tl, svalue(top - n), l * sizeof(char)); src/third_party/eris/lzio.c:60: [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); src/third_party/gettext/gettext.h:194: [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(msg_ctxt_id, msgctxt, msgctxt_len - 1); src/third_party/gettext/gettext.h:196: [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(msg_ctxt_id + msgctxt_len, msgid, msgid_len); src/third_party/gettext/gettext.h:232: [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(msg_ctxt_id, msgctxt, msgctxt_len - 1); src/third_party/gettext/gettext.h:234: [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(msg_ctxt_id + msgctxt_len, msgid, msgid_len); src/third_party/minizip/unzip.cc:1978: [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 = fopen(filename, mode_fopen); src/wui/building_statistics_menu.cc:742: [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 = std::atoi(cutoff.c_str()); src/wui/interactive_base.cc:854: [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). uint32_t serial = atoi(args[1].c_str()); src/wui/interactive_player.cc:318: [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 const n = atoi(args[1].c_str()); src/base/md5.cc:38: [1] (port) snprintf: On some very old systems, snprintf is incorrectly implemented and permits buffer overflows; there are also incompatible standard definitions of it. Check it during installation, or use something else. snprintf(buf, sizeof(buf), "%02x", data[i]); src/economy/cmd_call_economy_balance.cc:55: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdCallEconomyBalance::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/economy/cmd_call_economy_balance.cc:59: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). GameLogicCommand::read(fr, egbase, mol); src/economy/cmd_call_economy_balance.h:45: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/economy/economy_data_packet.cc:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void EconomyDataPacket::read(FileRead& fr) { src/economy/economy_data_packet.h:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&); src/economy/expedition_bootstrap.cc:225: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). wq->read(fr, game, mol); src/economy/expedition_bootstrap.cc:243: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). wq->read(fr, game, mol); src/economy/input_queue.cc:125: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void InputQueue::read(FileRead& fr, Game& game, MapObjectLoader& mol) { src/economy/input_queue.cc:145: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). request_->read(fr, game, mol); src/economy/input_queue.cc:161: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). request_->read(fr, game, mol); src/economy/input_queue.h:180: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead& f, Game& g, MapObjectLoader& mol); src/economy/request.cc:101: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void Request::read(FileRead& fr, Game& game, MapObjectLoader& mol) { src/economy/request.cc:158: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). requirements_.read(fr, game, mol); src/economy/request.h:119: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, Game&, MapObjectLoader&); src/economy/transfer.cc:284: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void Transfer::read(FileRead& fr, Transfer::ReadData& rd) { src/economy/transfer.h:77: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead& fr, ReadData& rd); src/economy/ware_instance.cc:532: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ware.transfer_->read(fr, transfer_); src/economy/workers_queue.cc:188: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). request_->read(fr, game, mol); src/game_io/game_class_packet.cc:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GameClassPacket::read(FileSystem& fs, Game& game, MapObjectLoader*) { src/game_io/game_class_packet.h:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, Game&, MapObjectLoader* = nullptr) override; src/game_io/game_cmd_queue_packet.cc:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GameCmdQueuePacket::read(FileSystem& fs, Game& game, MapObjectLoader* const ol) { src/game_io/game_cmd_queue_packet.cc:62: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cmd.read(fr, game, *ol); src/game_io/game_cmd_queue_packet.h:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, Game&, MapObjectLoader* = nullptr) override; src/game_io/game_data_packet.h:45: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual void read(FileSystem&, Game&, MapObjectLoader* = nullptr) = 0; src/game_io/game_interactive_player_packet.cc:50: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GameInteractivePlayerPacket::read(FileSystem& fs, Game& game, MapObjectLoader*) { src/game_io/game_interactive_player_packet.h:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, Game&, MapObjectLoader* = nullptr) override; src/game_io/game_loader.cc:57: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). mp.read(fs_, game_, nullptr); src/game_io/game_loader.cc:71: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(fs_, game_); src/game_io/game_loader.cc:78: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(fs_, game_); src/game_io/game_loader.cc:84: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). M.read(fs_, game_); src/game_io/game_loader.cc:90: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(fs_, game_); src/game_io/game_loader.cc:103: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(fs_, game_, mol); src/game_io/game_loader.cc:110: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(fs_, game_, mol); src/game_io/game_loader.cc:117: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(fs_, game_, mol); src/game_io/game_loader.cc:149: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(fs_, game_, mol); src/game_io/game_map_packet.cc:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GameMapPacket::read(FileSystem& fs, Game& game, MapObjectLoader* const) { src/game_io/game_map_packet.h:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, Game&, MapObjectLoader* = nullptr) override; src/game_io/game_player_ai_persistent_packet.cc:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GamePlayerAiPersistentPacket::read(FileSystem& fs, Game& game, MapObjectLoader*) { src/game_io/game_player_ai_persistent_packet.h:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, Game&, MapObjectLoader* = nullptr) override; src/game_io/game_player_economies_packet.cc:61: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GamePlayerEconomiesPacket::read(FileSystem& fs, Game& game, MapObjectLoader*) { src/game_io/game_player_economies_packet.cc:94: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). d.read(fr); src/game_io/game_player_economies_packet.cc:109: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). d.read(fr); src/game_io/game_player_economies_packet.h:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, Game&, MapObjectLoader* = nullptr) override; src/game_io/game_player_info_packet.cc:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GamePlayerInfoPacket::read(FileSystem& fs, Game& game, MapObjectLoader*) { src/game_io/game_player_info_packet.h:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, Game&, MapObjectLoader* = nullptr) override; src/game_io/game_preload_packet.cc:54: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GamePreloadPacket::read(FileSystem& fs, Game&, MapObjectLoader* const) { src/game_io/game_preload_packet.cc:57: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("preload", nullptr, fs); src/game_io/game_preload_packet.h:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, Game&, MapObjectLoader* = nullptr) override; src/io/filesystem/zip_filesystem.cc:252: [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 filename_inzip[strlen(filename_inzip) - 1] == '/'; src/io/streamwrite.h:97: [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). data(x, strlen(x) + 1); src/io/streamwrite.h:105: [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). data(x, strlen(x)); src/logic/ai_dna_handler.cc:54: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read(full_filename.c_str(), nullptr, *g_fs); src/logic/cmd_calculate_statistics.cc:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdCalculateStatistics::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/cmd_calculate_statistics.cc:41: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). GameLogicCommand::read(fr, egbase, mol); src/logic/cmd_calculate_statistics.h:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/cmd_incorporate.cc:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdIncorporate::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/cmd_incorporate.cc:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). GameLogicCommand::read(fr, egbase, mol); src/logic/cmd_incorporate.h:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/cmd_luacoroutine.cc:68: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdLuaCoroutine::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/cmd_luacoroutine.cc:72: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). GameLogicCommand::read(fr, egbase, mol); src/logic/cmd_luacoroutine.h:42: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/cmd_luascript.cc:49: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdLuaScript::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/cmd_luascript.cc:53: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). GameLogicCommand::read(fr, egbase, mol); src/logic/cmd_luascript.h:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/cmd_queue.cc:163: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GameLogicCommand::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader&) { src/logic/cmd_queue.h:103: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual void read(FileRead&, EditorGameBase&, MapObjectLoader&); src/logic/map_objects/immovable.cc:158: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers (CWE-120). strncpy(arguments.get(), parts[1].c_str(), parts[1].size() + 1); src/logic/map_objects/map_object.cc:60: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdDestroyMapObject::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/map_objects/map_object.cc:64: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). GameLogicCommand::read(fr, egbase, mol); src/logic/map_objects/map_object.cc:106: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdAct::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/map_objects/map_object.cc:110: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). GameLogicCommand::read(fr, egbase, mol); src/logic/map_objects/map_object.h:579: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/map_objects/map_object.h:597: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/map_objects/tribes/production_program.cc:1620: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers (CWE-120). strncpy(arguments.get(), parts[1].c_str(), parts[1].size() + 1); src/logic/map_objects/tribes/requirements.cc:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void Requirements::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/map_objects/tribes/requirements.cc:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). *this = RequirementsStorage::read(fr, egbase, mol); src/logic/map_objects/tribes/requirements.cc:78: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Requirements RequirementsStorage::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/map_objects/tribes/requirements.cc:127: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sub.read(fr, egbase, mol); src/logic/map_objects/tribes/requirements.cc:164: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sub.read(fr, egbase, mol); src/logic/map_objects/tribes/requirements.h:92: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&); src/logic/map_objects/tribes/requirements.h:119: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static Requirements read(FileRead&, EditorGameBase&, MapObjectLoader&); src/logic/map_objects/tribes/worker.cc:2606: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). worker.transfer_->read(fr, transfer_); src/logic/playercommand.cc:180: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void PlayerCommand::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:184: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). GameLogicCommand::read(fr, egbase, mol); src/logic/playercommand.cc:218: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdBulldoze::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:222: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:265: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdBuild::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:269: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:308: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdBuildFlag::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:312: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:384: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdBuildRoad::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:388: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:436: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdFlagAction::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:440: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:482: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdStartStopBuilding::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:486: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:540: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdMilitarySiteSetSoldierPreference::read(FileRead& fr, src/logic/playercommand.cc:546: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:578: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdStartOrCancelExpedition::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:582: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:623: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdEnhanceBuilding::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:627: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:669: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdDismantleBuilding::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:673: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:713: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdEvictWorker::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:717: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:769: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdShipScoutDirection::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:773: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:827: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdShipConstructPort::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:831: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:888: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdShipExploreIsland::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:892: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:936: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdShipSink::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:940: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:981: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdShipCancelExpedition::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:985: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:1043: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdSetWarePriority::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1047: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:1121: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdSetInputMaxFill::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1125: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:1182: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdChangeTargetQuantity::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1184: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:1227: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdSetWareTargetQuantity::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1231: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CmdChangeTargetQuantity::read(fr, egbase, mol); src/logic/playercommand.cc:1278: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdResetWareTargetQuantity::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1282: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CmdChangeTargetQuantity::read(fr, egbase, mol); src/logic/playercommand.cc:1326: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdSetWorkerTargetQuantity::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1330: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CmdChangeTargetQuantity::read(fr, egbase, mol); src/logic/playercommand.cc:1379: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdResetWorkerTargetQuantity::read(FileRead& fr, src/logic/playercommand.cc:1385: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). CmdChangeTargetQuantity::read(fr, egbase, mol); src/logic/playercommand.cc:1427: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdChangeTrainingOptions::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1431: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:1479: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdDropSoldier::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1483: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:1543: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdChangeSoldierCapacity::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1547: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:1611: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdEnemyFlagAction::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1615: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:1653: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void PlayerMessageCommand::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1657: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.cc:1763: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CmdSetStockPolicy::read(FileRead& fr, EditorGameBase& egbase, MapObjectLoader& mol) { src/logic/playercommand.cc:1767: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PlayerCommand::read(fr, egbase, mol); src/logic/playercommand.h:68: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:88: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:112: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:136: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:158: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:182: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:205: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:231: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:254: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:281: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:306: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:330: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:353: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:377: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:404: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:427: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:450: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:478: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:508: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:536: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:566: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:591: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:614: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:639: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:665: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:691: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:716: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:741: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:766: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/logic/playercommand.h:838: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileRead&, EditorGameBase&, MapObjectLoader&) override; src/map_io/map_allowed_building_types_packet.cc:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapAllowedBuildingTypesPacket::read(FileSystem& fs, src/map_io/map_allowed_building_types_packet.cc:44: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("allowed_building_types", nullptr, fs); src/map_io/map_allowed_building_types_packet.cc:47: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("allowed_buildings", nullptr, fs); src/map_io/map_allowed_worker_types_packet.cc:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapAllowedWorkerTypesPacket::read(FileSystem& fs, src/map_io/map_allowed_worker_types_packet.cc:48: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("allowed_worker_types", nullptr, fs); src/map_io/map_bob_packet.cc:71: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapBobPacket::read(FileSystem& fs, src/map_io/map_bob_packet.h:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(FileSystem&, EditorGameBase&, MapObjectLoader&, const WorldLegacyLookupTable& lookup_table); src/map_io/map_building_packet.cc:47: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapBuildingPacket::read(FileSystem& fs, src/map_io/map_building_packet.h:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, EditorGameBase&, bool, MapObjectLoader&); src/map_io/map_buildingdata_packet.cc:70: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapBuildingdataPacket::read(FileSystem& fs, src/map_io/map_buildingdata_packet.cc:229: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). pfb.builder_request_->read(fr, game, mol); src/map_io/map_buildingdata_packet.cc:247: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). pfb.wares_[i]->read(fr, game, mol); src/map_io/map_buildingdata_packet.cc:417: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). pw.requests.back()->read(fr, game, mol); src/map_io/map_buildingdata_packet.cc:473: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). militarysite.normal_soldier_request_->read(fr, game, mol); src/map_io/map_buildingdata_packet.cc:482: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). militarysite.upgrade_soldier_request_->read(fr, game, mol); src/map_io/map_buildingdata_packet.cc:563: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). req.read(fr, game, mol); src/map_io/map_buildingdata_packet.cc:683: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). wq->read(fr, game, mol); src/map_io/map_buildingdata_packet.cc:696: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). wq->read(fr, game, mol); src/map_io/map_buildingdata_packet.cc:737: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). trainingsite.soldier_request_->read(fr, game, mol); src/map_io/map_buildingdata_packet.h:45: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, EditorGameBase&, bool, MapObjectLoader&); src/map_io/map_data_packet.h:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, EditorGameBase&, bool, MapObjectLoader&); \ src/map_io/map_elemental_packet.cc:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("elemental", nullptr, fs); src/map_io/map_elemental_packet.cc:116: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapElementalPacket::read(FileSystem& fs, EditorGameBase& egbase, bool, MapObjectLoader&) { src/map_io/map_elemental_packet.h:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, EditorGameBase&, bool, MapObjectLoader&); src/map_io/map_exploration_packet.cc:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapExplorationPacket::read(FileSystem& fs, src/map_io/map_flag_packet.cc:40: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapFlagPacket::read(FileSystem& fs, src/map_io/map_flagdata_packet.cc:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapFlagdataPacket::read(FileSystem& fs, src/map_io/map_flagdata_packet.cc:134: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). f.request->read(fr, dynamic_cast(egbase), mol); src/map_io/map_heights_packet.cc:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapHeightsPacket::read(FileSystem& fs, EditorGameBase& egbase, bool, MapObjectLoader&) { src/map_io/map_node_ownership_packet.cc:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapNodeOwnershipPacket::read(FileSystem& fs, src/map_io/map_object_packet.cc:48: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapObjectPacket::read(FileSystem& fs, src/map_io/map_object_packet.h:56: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, src/map_io/map_objective_packet.cc:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("objective", nullptr, fs); src/map_io/map_player_names_and_tribes_packet.cc:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapPlayerNamesAndTribesPacket::read(FileSystem& fs, src/map_io/map_player_names_and_tribes_packet.cc:55: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("player_names", nullptr, fs); src/map_io/map_player_names_and_tribes_packet.h:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual void read(FileSystem&, EditorGameBase&, bool, MapObjectLoader&); src/map_io/map_player_position_packet.cc:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapPlayerPositionPacket::read(FileSystem& fs, EditorGameBase& egbase, bool, MapObjectLoader&) { src/map_io/map_player_position_packet.cc:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("player_position", nullptr, fs); src/map_io/map_players_messages_packet.cc:41: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapPlayersMessagesPacket::read(FileSystem& fs, src/map_io/map_players_messages_packet.cc:56: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read(profile_filename.c_str(), nullptr, fs); src/map_io/map_players_view_packet.cc:281: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapPlayersViewPacket::read(FileSystem& fs, src/map_io/map_port_spaces_packet.cc:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapPortSpacesPacket::read(FileSystem& fs, EditorGameBase& egbase, bool, MapObjectLoader&) { src/map_io/map_port_spaces_packet.cc:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("port_spaces", nullptr, fs); src/map_io/map_port_spaces_packet.h:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, EditorGameBase&, bool, MapObjectLoader&); src/map_io/map_resources_packet.cc:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapResourcesPacket::read(FileSystem& fs, src/map_io/map_resources_packet.h:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, EditorGameBase&, const WorldLegacyLookupTable&); src/map_io/map_road_packet.cc:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapRoadPacket::read(FileSystem& fs, src/map_io/map_roaddata_packet.cc:44: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapRoaddataPacket::read(FileSystem& fs, src/map_io/map_roaddata_packet.cc:141: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ->read(fr, game, mol); src/map_io/map_scripting_packet.cc:47: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapScriptingPacket::read(FileSystem& fs, EditorGameBase& egbase, bool, MapObjectLoader& mol) { src/map_io/map_terrain_packet.cc:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapTerrainPacket::read(FileSystem& fs, src/map_io/map_terrain_packet.h:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FileSystem&, EditorGameBase&, const WorldLegacyLookupTable& lookup_table); src/map_io/map_version_packet.cc:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MapVersionPacket::read(FileSystem& fs, src/map_io/map_version_packet.cc:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("version", nullptr, fs); src/map_io/widelands_map_loader.cc:122: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). elemental_data_packet.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:131: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:140: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:148: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:158: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, *world_lookup_table); src/map_io/widelands_map_loader.cc:165: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). mapobjects.read(*fs_, egbase, *mol_, *world_lookup_table, *tribe_lookup_table); src/map_io/widelands_map_loader.cc:171: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:182: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, *mol_, *world_lookup_table); src/map_io/widelands_map_loader.cc:190: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, *world_lookup_table); src/map_io/widelands_map_loader.cc:200: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:207: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:214: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:221: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:228: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:239: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:246: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:253: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:261: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:268: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:275: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:299: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:309: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/map_io/widelands_map_loader.cc:326: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(*fs_, egbase, is_game, *mol_); src/network/network_lan_promotion.cc:380: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers (CWE-120). strncpy(gameinfo.gameversion, build_id().c_str(), sizeof(gameinfo.gameversion)); src/network/network_lan_promotion.cc:382: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers (CWE-120). strncpy(gameinfo.hostname, boost::asio::ip::host_name().c_str(), sizeof(gameinfo.hostname)); src/network/network_lan_promotion.cc:419: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers (CWE-120). strncpy(gameinfo.map, map, sizeof(gameinfo.map)); src/network/network_lan_promotion.cc:436: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers (CWE-120). Risk is low because the source is a constant string. strncpy(magic, "QUERY", 8); src/profile/profile.cc:154: [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 auto len = strlen(value) + 1; src/profile/profile.cc:485: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(filename, global_section); src/profile/profile.cc:494: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(filename, global_section); src/profile/profile.cc:636: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void Profile::read(char const* const filename, char const* const global_section, FileSystem& fs) { src/profile/profile.cc:683: [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 (char* eot = line + strlen(line) - 1; *eot != '"' && *eot != '\''; --eot) src/profile/profile.cc:713: [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* const eot = tail + strlen(tail) - 1; src/profile/profile.cc:717: [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* const eot2 = tail + strlen(tail) - 1; src/profile/profile.cc:782: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). uint32_t spaces = strlen(temp_value.get_name()); src/profile/profile.cc:785: [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 (uint32_t i = 0; i < strlen(str); ++i) { src/profile/profile.h:196: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(const char* const filename, src/scripting/logic.cc:151: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rv->read(lua_state_, fr); src/scripting/lua_coroutine.cc:154: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void LuaCoroutine::read(lua_State* parent, FileRead& fr) { src/scripting/lua_coroutine.h:77: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(lua_State*, FileRead&); src/scripting/luna.h:100: [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(sub_namespace) != 0) { src/scripting/test/test_luna.cc:232: [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). BOOST_REQUIRE_EQUAL(0, luaL_loadbuffer(L, script1, strlen(script1), "testscript1")); src/scripting/test/test_luna.cc:246: [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). BOOST_REQUIRE_EQUAL(0, luaL_loadbuffer(L, script1, strlen(script1), "testscript1")); src/scripting/test/test_luna.cc:265: [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). BOOST_REQUIRE_EQUAL(0, luaL_loadbuffer(L, script2, strlen(script2), "testscript2")); src/scripting/test/test_luna.cc:282: [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). BOOST_REQUIRE_EQUAL(0, luaL_loadbuffer(L, script3, strlen(script3), "testscript3")); src/scripting/test/test_luna.cc:299: [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). BOOST_REQUIRE_EQUAL(0, luaL_loadbuffer(L, script4, strlen(script4), "testscript4")); src/scripting/test/test_luna.cc:317: [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). BOOST_REQUIRE_EQUAL(0, luaL_loadbuffer(L, script5, strlen(script5), "testscript5")); src/scripting/test/test_luna.cc:334: [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). BOOST_REQUIRE_EQUAL(0, luaL_loadbuffer(L, script6, strlen(script6), "testscript6")); src/scripting/test/test_luna.cc:352: [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). BOOST_REQUIRE_EQUAL(0, luaL_loadbuffer(L, script6, strlen(script6), "testscript6")); src/third_party/eris/lauxlib.c:387: [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); src/third_party/eris/lauxlib.c:524: [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)); src/third_party/eris/lauxlib.c:660: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(lf->f); src/third_party/eris/lauxlib.c:665: [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 */ src/third_party/eris/lauxlib.c:680: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(lf->f); src/third_party/eris/lauxlib.c:682: [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 */ src/third_party/eris/lauxlib.c:751: [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); src/third_party/eris/lauxlib.c:838: [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); src/third_party/eris/lauxlib.c:971: [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); src/third_party/eris/ldblib.c:409: [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)") || src/third_party/eris/liolib.c: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). (strspn(mode, L_MODEEXT) == strlen(mode))) src/third_party/eris/liolib.c:89: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define l_getc(f) getc(f) src/third_party/eris/liolib.c:466: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc(f); src/third_party/eris/loadlib.c:390: [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); src/third_party/eris/lobject.c:366: [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)); src/third_party/eris/lobject.c:417: [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)); src/third_party/eris/lobject.c:443: [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); src/third_party/eris/lstring.c:231: [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[0] = luaS_newlstr(L, str, strlen(str)); src/third_party/eris/lstrlib.c:597: [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 */ src/third_party/eris/lstrlib.c:975: [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); src/third_party/eris/lstrlib.c:976: [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); src/third_party/eris/lstrlib.c:1037: [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, l == strlen(s), arg, "string contains zeros"); src/third_party/eris/lstrlib.c:1369: [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"); src/third_party/eris/lstrlib.c:1493: [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); src/third_party/eris/lua.c:211: [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)); src/third_party/eris/lua.c:249: [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)); src/third_party/eris/lua.c:314: [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); src/third_party/eris/lua.c:333: [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 status = luaL_loadbuffer(L, retline, strlen(retline), "=stdin"); src/third_party/eris/lundump.c:221: [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); src/third_party/eris/lvm.c:245: [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 */ src/third_party/gettext/gettext.h:181: [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 msgctxt_len = strlen(msgctxt) + 1; src/third_party/gettext/gettext.h:182: [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 msgid_len = strlen(msgid) + 1; src/third_party/gettext/gettext.h:219: [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 msgctxt_len = strlen(msgctxt) + 1; src/third_party/gettext/gettext.h:220: [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 msgid_len = strlen(msgid) + 1; src/third_party/minizip/unzip.cc:1552: [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_comment = comment ? static_cast(strlen(comment)) : 0; src/third_party/minizip/unzip.cc:1554: [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_filename = static_cast(strlen(filename)); src/third_party/minizip/unzip.cc:1860: [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_global_comment = global_comment ? static_cast(strlen(global_comment)) : 0; src/ui_fsmenu/launch_mpg.cc:306: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("map/elemental", nullptr, *l_fs); src/ui_fsmenu/launch_mpg.cc:467: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). prof.read("map/player_names", nullptr, *l_fs); src/wlapplication.cc:723: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). g_options.read("config", "global"); src/wui/chat_msg_layout.cc:36: [1] (port) snprintf: On some very old systems, snprintf is incorrectly implemented and permits buffer overflows; there are also incompatible standard definitions of it. Check it during installation, or use something else. snprintf(buf, sizeof(buf), "%.2x%.2x%.2x", clr.r, clr.g, clr.b); ANALYSIS SUMMARY: Hits = 484 Lines analyzed = 209142 in approximately 5.01 seconds (41711 lines/second) Physical Source Lines of Code (SLOC) = 134173 Hits@level = [0] 0 [1] 317 [2] 121 [3] 15 [4] 30 [5] 1 Hits@level+ = [0+] 484 [1+] 484 [2+] 167 [3+] 46 [4+] 31 [5+] 1 Hits/KSLOC@level+ = [0+] 3.60728 [1+] 3.60728 [2+] 1.24466 [3+] 0.342841 [4+] 0.231045 [5+] 0.00745306 Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming for Linux and Unix HOWTO' (http://www.dwheeler.com/secure-programs) for more information.