Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/mgba-0.8.4+dfsg/include/mgba-util/arm-algo.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/circle-buffer.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/common.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/configuration.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/crc32.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/elf-read.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/export.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/formatting.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/gui.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/gui/file-select.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/gui/font-metrics.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/gui/font.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/gui/menu.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/hash.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/math.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/memory.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/patch.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/patch/fast.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/patch/ips.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/patch/ups.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/platform/3ds/3ds-vfs.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/platform/3ds/threading.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/platform/posix/threading.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/platform/psp2/sce-vfs.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/platform/psp2/threading.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/platform/switch/threading.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/getopt.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/threading.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/png-io.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/ring-fifo.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/socket.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/string.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/table.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/text-codec.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/threading.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/vector.h Examining data/mgba-0.8.4+dfsg/include/mgba-util/vfs.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/bitmap-cache.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/blip_buf.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/cache-set.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/cheats.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/config.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/core.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/cpu.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/directories.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/input.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/interface.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/library.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/lockstep.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/log.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/map-cache.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/mem-search.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/rewind.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/scripting.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/serialize.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/sync.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/thread.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/tile-cache.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/timing.h Examining data/mgba-0.8.4+dfsg/include/mgba/core/version.h Examining data/mgba-0.8.4+dfsg/include/mgba/debugger/debugger.h Examining data/mgba-0.8.4+dfsg/include/mgba/feature/commandline.h Examining data/mgba-0.8.4+dfsg/include/mgba/feature/thread-proxy.h Examining data/mgba-0.8.4+dfsg/include/mgba/feature/video-logger.h Examining data/mgba-0.8.4+dfsg/include/mgba/gb/core.h Examining data/mgba-0.8.4+dfsg/include/mgba/gb/interface.h Examining data/mgba-0.8.4+dfsg/include/mgba/gba/core.h Examining data/mgba-0.8.4+dfsg/include/mgba/gba/interface.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/arm.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/debugger/cli-debugger.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/debugger/debugger.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/debugger/memory-debugger.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/decoder-inlines.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/decoder.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/emitter-arm.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/emitter-inlines.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/emitter-thumb.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/isa-arm.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/isa-inlines.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/isa-thumb.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/arm/macros.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/debugger/cli-debugger.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/debugger/gdb-stub.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/debugger/parser.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/debugger/symbols.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/audio.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/cheats.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/debugger/debugger.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/debugger/symbols.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/extra/cli.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/gb.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/io.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/mbc.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/memory.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/overrides.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/renderers/cache-set.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/renderers/proxy.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/renderers/software.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/serialize.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/sio.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/sio/lockstep.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/sio/printer.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/timer.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gb/video.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/audio.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/bios.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/cheats.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/dma.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/extra/audio-mixer.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/extra/cli.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/gba.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/hardware.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/input.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/io.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/matrix.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/memory.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/overrides.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/renderers/cache-set.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/renderers/common.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/renderers/gl.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/renderers/proxy.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/renderers/video-software.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/rr/mgm.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/rr/rr.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/rr/vbm.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/savedata.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/serialize.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/sharkport.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/sio.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/sio/lockstep.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/timer.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/vfame.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/gba/video.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/sm83/debugger/cli-debugger.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/sm83/debugger/debugger.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/sm83/debugger/memory-debugger.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/sm83/decoder.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/sm83/emitter-sm83.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/sm83/isa-sm83.h Examining data/mgba-0.8.4+dfsg/include/mgba/internal/sm83/sm83.h Examining data/mgba-0.8.4+dfsg/opt/libgba/mgba.c Examining data/mgba-0.8.4+dfsg/opt/libgba/mgba.h Examining data/mgba-0.8.4+dfsg/src/arm/arm.c Examining data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c Examining data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c Examining data/mgba-0.8.4+dfsg/src/arm/debugger/memory-debugger.c Examining data/mgba-0.8.4+dfsg/src/arm/decoder-arm.c Examining data/mgba-0.8.4+dfsg/src/arm/decoder-thumb.c Examining data/mgba-0.8.4+dfsg/src/arm/decoder.c Examining data/mgba-0.8.4+dfsg/src/arm/isa-arm.c Examining data/mgba-0.8.4+dfsg/src/arm/isa-thumb.c Examining data/mgba-0.8.4+dfsg/src/core/bitmap-cache.c Examining data/mgba-0.8.4+dfsg/src/core/cache-set.c Examining data/mgba-0.8.4+dfsg/src/core/cheats.c Examining data/mgba-0.8.4+dfsg/src/core/config.c Examining data/mgba-0.8.4+dfsg/src/core/core.c Examining data/mgba-0.8.4+dfsg/src/core/directories.c Examining data/mgba-0.8.4+dfsg/src/core/input.c Examining data/mgba-0.8.4+dfsg/src/core/interface.c Examining data/mgba-0.8.4+dfsg/src/core/library.c Examining data/mgba-0.8.4+dfsg/src/core/lockstep.c Examining data/mgba-0.8.4+dfsg/src/core/log.c Examining data/mgba-0.8.4+dfsg/src/core/map-cache.c Examining data/mgba-0.8.4+dfsg/src/core/mem-search.c Examining data/mgba-0.8.4+dfsg/src/core/rewind.c Examining data/mgba-0.8.4+dfsg/src/core/scripting.c Examining data/mgba-0.8.4+dfsg/src/core/serialize.c Examining data/mgba-0.8.4+dfsg/src/core/sync.c Examining data/mgba-0.8.4+dfsg/src/core/test/core.c Examining data/mgba-0.8.4+dfsg/src/core/test/core.h Examining data/mgba-0.8.4+dfsg/src/core/thread.c Examining data/mgba-0.8.4+dfsg/src/core/tile-cache.c Examining data/mgba-0.8.4+dfsg/src/core/timing.c Examining data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c Examining data/mgba-0.8.4+dfsg/src/debugger/debugger.c Examining data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c Examining data/mgba-0.8.4+dfsg/src/debugger/parser.c Examining data/mgba-0.8.4+dfsg/src/debugger/symbols.c Examining data/mgba-0.8.4+dfsg/src/debugger/test/lexer.c Examining data/mgba-0.8.4+dfsg/src/debugger/test/parser.c Examining data/mgba-0.8.4+dfsg/src/feature/commandline.c Examining data/mgba-0.8.4+dfsg/src/feature/editline/cli-el-backend.c Examining data/mgba-0.8.4+dfsg/src/feature/editline/cli-el-backend.h Examining data/mgba-0.8.4+dfsg/src/feature/ffmpeg/ffmpeg-encoder.c Examining data/mgba-0.8.4+dfsg/src/feature/ffmpeg/ffmpeg-encoder.h Examining data/mgba-0.8.4+dfsg/src/feature/gui/gui-config.c Examining data/mgba-0.8.4+dfsg/src/feature/gui/gui-config.h Examining data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c Examining data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.h Examining data/mgba-0.8.4+dfsg/src/feature/gui/remap.c Examining data/mgba-0.8.4+dfsg/src/feature/gui/remap.h Examining data/mgba-0.8.4+dfsg/src/feature/sqlite3/no-intro.c Examining data/mgba-0.8.4+dfsg/src/feature/sqlite3/no-intro.h Examining data/mgba-0.8.4+dfsg/src/feature/thread-proxy.c Examining data/mgba-0.8.4+dfsg/src/feature/video-logger.c Examining data/mgba-0.8.4+dfsg/src/gb/audio.c Examining data/mgba-0.8.4+dfsg/src/gb/cheats.c Examining data/mgba-0.8.4+dfsg/src/gb/core.c Examining data/mgba-0.8.4+dfsg/src/gb/debugger/cli.c Examining data/mgba-0.8.4+dfsg/src/gb/debugger/debugger.c Examining data/mgba-0.8.4+dfsg/src/gb/debugger/symbols.c Examining data/mgba-0.8.4+dfsg/src/gb/extra/proxy.c Examining data/mgba-0.8.4+dfsg/src/gb/gb.c Examining data/mgba-0.8.4+dfsg/src/gb/io.c Examining data/mgba-0.8.4+dfsg/src/gb/mbc.c Examining data/mgba-0.8.4+dfsg/src/gb/memory.c Examining data/mgba-0.8.4+dfsg/src/gb/overrides.c Examining data/mgba-0.8.4+dfsg/src/gb/renderers/cache-set.c Examining data/mgba-0.8.4+dfsg/src/gb/renderers/software.c Examining data/mgba-0.8.4+dfsg/src/gb/serialize.c Examining data/mgba-0.8.4+dfsg/src/gb/sio.c Examining data/mgba-0.8.4+dfsg/src/gb/sio/lockstep.c Examining data/mgba-0.8.4+dfsg/src/gb/sio/printer.c Examining data/mgba-0.8.4+dfsg/src/gb/test/core.c Examining data/mgba-0.8.4+dfsg/src/gb/test/mbc.c Examining data/mgba-0.8.4+dfsg/src/gb/test/memory.c Examining data/mgba-0.8.4+dfsg/src/gb/test/rtc.c Examining data/mgba-0.8.4+dfsg/src/gb/timer.c Examining data/mgba-0.8.4+dfsg/src/gb/video.c Examining data/mgba-0.8.4+dfsg/src/gba/audio.c Examining data/mgba-0.8.4+dfsg/src/gba/bios.c Examining data/mgba-0.8.4+dfsg/src/gba/cheats.c Examining data/mgba-0.8.4+dfsg/src/gba/cheats/codebreaker.c Examining data/mgba-0.8.4+dfsg/src/gba/cheats/gameshark.c Examining data/mgba-0.8.4+dfsg/src/gba/cheats/gameshark.h Examining data/mgba-0.8.4+dfsg/src/gba/cheats/parv3.c Examining data/mgba-0.8.4+dfsg/src/gba/cheats/parv3.h Examining data/mgba-0.8.4+dfsg/src/gba/core.c Examining data/mgba-0.8.4+dfsg/src/gba/debugger/cli.c Examining data/mgba-0.8.4+dfsg/src/gba/dma.c Examining data/mgba-0.8.4+dfsg/src/gba/extra/audio-mixer.c Examining data/mgba-0.8.4+dfsg/src/gba/extra/battlechip.c Examining data/mgba-0.8.4+dfsg/src/gba/extra/proxy.c Examining data/mgba-0.8.4+dfsg/src/gba/gba.c Examining data/mgba-0.8.4+dfsg/src/gba/hardware.c Examining data/mgba-0.8.4+dfsg/src/gba/hle-bios.c Examining data/mgba-0.8.4+dfsg/src/gba/hle-bios.h Examining data/mgba-0.8.4+dfsg/src/gba/input.c Examining data/mgba-0.8.4+dfsg/src/gba/io.c Examining data/mgba-0.8.4+dfsg/src/gba/matrix.c Examining data/mgba-0.8.4+dfsg/src/gba/memory.c Examining data/mgba-0.8.4+dfsg/src/gba/overrides.c Examining data/mgba-0.8.4+dfsg/src/gba/renderers/cache-set.c Examining data/mgba-0.8.4+dfsg/src/gba/renderers/common.c Examining data/mgba-0.8.4+dfsg/src/gba/renderers/gl.c Examining data/mgba-0.8.4+dfsg/src/gba/renderers/software-bg.c Examining data/mgba-0.8.4+dfsg/src/gba/renderers/software-mode0.c Examining data/mgba-0.8.4+dfsg/src/gba/renderers/software-obj.c Examining data/mgba-0.8.4+dfsg/src/gba/renderers/software-private.h Examining data/mgba-0.8.4+dfsg/src/gba/renderers/video-software.c Examining data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c Examining data/mgba-0.8.4+dfsg/src/gba/rr/rr.c Examining data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c Examining data/mgba-0.8.4+dfsg/src/gba/savedata.c Examining data/mgba-0.8.4+dfsg/src/gba/serialize.c Examining data/mgba-0.8.4+dfsg/src/gba/sharkport.c Examining data/mgba-0.8.4+dfsg/src/gba/sio.c Examining data/mgba-0.8.4+dfsg/src/gba/sio/joybus.c Examining data/mgba-0.8.4+dfsg/src/gba/sio/lockstep.c Examining data/mgba-0.8.4+dfsg/src/gba/test/cheats.c Examining data/mgba-0.8.4+dfsg/src/gba/test/core.c Examining data/mgba-0.8.4+dfsg/src/gba/timer.c Examining data/mgba-0.8.4+dfsg/src/gba/vfame.c Examining data/mgba-0.8.4+dfsg/src/gba/video.c Examining data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-memory.c Examining data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c Examining data/mgba-0.8.4+dfsg/src/platform/3ds/ctr-gpu.c Examining data/mgba-0.8.4+dfsg/src/platform/3ds/ctr-gpu.h Examining data/mgba-0.8.4+dfsg/src/platform/3ds/ctru-heap.c Examining data/mgba-0.8.4+dfsg/src/platform/3ds/gui-font.c Examining data/mgba-0.8.4+dfsg/src/platform/3ds/main.c Examining data/mgba-0.8.4+dfsg/src/platform/3ds/socket.c Examining data/mgba-0.8.4+dfsg/src/platform/example/client-server/client.c Examining data/mgba-0.8.4+dfsg/src/platform/example/client-server/server.c Examining data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.c Examining data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.h Examining data/mgba-0.8.4+dfsg/src/platform/libretro/libretro_core_options.h Examining data/mgba-0.8.4+dfsg/src/platform/libretro/libretro_core_options_intl.h Examining data/mgba-0.8.4+dfsg/src/platform/libretro/retro_inline.h Examining data/mgba-0.8.4+dfsg/src/platform/openemu/OEGBASystemResponderClient.h Examining data/mgba-0.8.4+dfsg/src/platform/openemu/mGBAGameCore.h Examining data/mgba-0.8.4+dfsg/src/platform/opengl/gl.c Examining data/mgba-0.8.4+dfsg/src/platform/opengl/gl.h Examining data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.c Examining data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.h Examining data/mgba-0.8.4+dfsg/src/platform/posix/memory.c Examining data/mgba-0.8.4+dfsg/src/platform/psp2/gui-font.c Examining data/mgba-0.8.4+dfsg/src/platform/psp2/main.c Examining data/mgba-0.8.4+dfsg/src/platform/psp2/psp2-common.h Examining data/mgba-0.8.4+dfsg/src/platform/psp2/psp2-context.c Examining data/mgba-0.8.4+dfsg/src/platform/psp2/psp2-context.h Examining data/mgba-0.8.4+dfsg/src/platform/psp2/psp2-memory.c Examining data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c Examining data/mgba-0.8.4+dfsg/src/platform/python/_builder.h Examining data/mgba-0.8.4+dfsg/src/platform/python/core.c Examining data/mgba-0.8.4+dfsg/src/platform/python/core.h Examining data/mgba-0.8.4+dfsg/src/platform/python/engine.c Examining data/mgba-0.8.4+dfsg/src/platform/python/engine.h Examining data/mgba-0.8.4+dfsg/src/platform/python/lib.h Examining data/mgba-0.8.4+dfsg/src/platform/python/log.c Examining data/mgba-0.8.4+dfsg/src/platform/python/log.h Examining data/mgba-0.8.4+dfsg/src/platform/python/pycommon.h Examining data/mgba-0.8.4+dfsg/src/platform/python/sio.c Examining data/mgba-0.8.4+dfsg/src/platform/python/sio.h Examining data/mgba-0.8.4+dfsg/src/platform/python/vfs-py.c Examining data/mgba-0.8.4+dfsg/src/platform/python/vfs-py.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/AboutScreen.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/AboutScreen.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/AbstractUpdater.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/AbstractUpdater.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/Action.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/Action.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ActionMapper.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ActionMapper.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ArchiveInspector.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ArchiveInspector.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/AssetInfo.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/AssetInfo.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/AssetTile.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/AssetTile.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/AssetView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/AssetView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/AudioDevice.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/AudioDevice.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/AudioProcessor.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/AudioProcessor.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/AudioProcessorQt.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/AudioProcessorQt.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/AudioProcessorSDL.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/AudioProcessorSDL.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/BattleChipModel.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/BattleChipModel.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/BattleChipUpdater.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/BattleChipUpdater.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/BattleChipView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/BattleChipView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/CheatsModel.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/CheatsModel.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/CheatsView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/CheatsView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ColorPicker.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ColorPicker.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ConfigController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ConfigController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/CoreManager.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/CoreManager.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerConsole.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerConsole.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerConsoleController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerConsoleController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/DiscordCoordinator.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/DiscordCoordinator.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/Display.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/Display.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/DisplayGL.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/DisplayGL.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/DisplayQt.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/DisplayQt.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/FrameView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/FrameView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GBAApp.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GBAApp.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GBAKeyEditor.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GBAKeyEditor.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GBAOverride.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GBAOverride.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GBOverride.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GBOverride.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GDBController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GDBController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GDBWindow.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GDBWindow.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GIFView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GIFView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GamepadAxisEvent.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GamepadAxisEvent.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GamepadButtonEvent.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GamepadButtonEvent.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/GamepadHatEvent.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/GamepadHatEvent.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/IOViewer.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/IOViewer.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/InputController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/InputController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/InputProfile.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/InputProfile.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/KeyEditor.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/KeyEditor.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/LoadSaveState.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/LoadSaveState.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/LogConfigModel.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/LogConfigModel.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/LogController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/LogController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/LogView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/LogView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/MapView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/MapView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/MemoryDump.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/MemoryDump.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/MemoryModel.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/MemoryModel.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/MemorySearch.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/MemorySearch.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/MemoryView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/MemoryView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/MessagePainter.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/MessagePainter.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/MultiplayerController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/MultiplayerController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ObjView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ObjView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/Override.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/OverrideView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/OverrideView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/PaletteView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/PaletteView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/PlacementControl.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/PlacementControl.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/PrinterView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/PrinterView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ROMInfo.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ROMInfo.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/RegisterView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/RegisterView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/RotatedHeaderView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/RotatedHeaderView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/SavestateButton.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/SavestateButton.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/SensorView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/SensorView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/SettingsView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/SettingsView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ShaderSelector.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ShaderSelector.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ShortcutController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ShortcutController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ShortcutModel.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ShortcutModel.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/ShortcutView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/ShortcutView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/Swatch.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/Swatch.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/TilePainter.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/TilePainter.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/TileView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/TileView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/VFileDevice.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/VFileDevice.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/VideoDumper.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/VideoDumper.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/VideoProxy.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/VideoProxy.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/VideoView.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/VideoView.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/Window.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/Window.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/library/LibraryController.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/library/LibraryController.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/library/LibraryGrid.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/library/LibraryGrid.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/library/LibraryTree.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/library/LibraryTree.h Examining data/mgba-0.8.4+dfsg/src/platform/qt/main.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/utils.cpp Examining data/mgba-0.8.4+dfsg/src/platform/qt/utils.h Examining data/mgba-0.8.4+dfsg/src/platform/sdl/gl-common.c Examining data/mgba-0.8.4+dfsg/src/platform/sdl/gl-common.h Examining data/mgba-0.8.4+dfsg/src/platform/sdl/gl-sdl.c Examining data/mgba-0.8.4+dfsg/src/platform/sdl/gles2-sdl.c Examining data/mgba-0.8.4+dfsg/src/platform/sdl/main.c Examining data/mgba-0.8.4+dfsg/src/platform/sdl/main.h Examining data/mgba-0.8.4+dfsg/src/platform/sdl/pandora-sdl.c Examining data/mgba-0.8.4+dfsg/src/platform/sdl/rpi-common.c Examining data/mgba-0.8.4+dfsg/src/platform/sdl/rpi-common.h Examining data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-audio.c Examining data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-audio.h Examining data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-events.c Examining data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-events.h Examining data/mgba-0.8.4+dfsg/src/platform/sdl/sw-sdl1.c Examining data/mgba-0.8.4+dfsg/src/platform/sdl/sw-sdl2.c Examining data/mgba-0.8.4+dfsg/src/platform/switch/gui-font.c Examining data/mgba-0.8.4+dfsg/src/platform/switch/main.c Examining data/mgba-0.8.4+dfsg/src/platform/switch/memory.c Examining data/mgba-0.8.4+dfsg/src/platform/test/fuzz-main.c Examining data/mgba-0.8.4+dfsg/src/platform/test/perf-main.c Examining data/mgba-0.8.4+dfsg/src/platform/test/tbl-fuzz-main.c Examining data/mgba-0.8.4+dfsg/src/platform/video-backend.h Examining data/mgba-0.8.4+dfsg/src/platform/wii/gui-font.c Examining data/mgba-0.8.4+dfsg/src/platform/wii/main.c Examining data/mgba-0.8.4+dfsg/src/platform/wii/wii-memory.c Examining data/mgba-0.8.4+dfsg/src/platform/windows/memory.c Examining data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c Examining data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c Examining data/mgba-0.8.4+dfsg/src/sm83/debugger/debugger.c Examining data/mgba-0.8.4+dfsg/src/sm83/debugger/memory-debugger.c Examining data/mgba-0.8.4+dfsg/src/sm83/decoder.c Examining data/mgba-0.8.4+dfsg/src/sm83/isa-sm83.c Examining data/mgba-0.8.4+dfsg/src/sm83/sm83.c Examining data/mgba-0.8.4+dfsg/src/third-party/blip_buf/blip_buf.c Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/include/discord_register.h Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/include/discord_rpc.h Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/backoff.h Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/connection.h Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/connection_unix.cpp Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/connection_win.cpp Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/dllmain.cpp Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/msg_queue.h Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/rpc_connection.cpp Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/rpc_connection.h Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/serialization.cpp Examining data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/serialization.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7z.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zAlloc.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zAlloc.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zArcIn.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zBuf.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zBuf.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zBuf2.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zCrc.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zCrc.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zCrcOpt.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zDec.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zFile.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zFile.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zStream.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zTypes.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/7zVersion.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Aes.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Aes.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/AesOpt.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Alloc.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Alloc.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Bcj2.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Bcj2.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Bcj2Enc.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Bra.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Bra.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Bra86.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/BraIA64.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Compiler.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/CpuArch.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/CpuArch.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Delta.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Delta.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/DllSecur.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/DllSecur.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzFind.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzFind.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzFindMt.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzFindMt.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzHash.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2Dec.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2Dec.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2DecMt.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2DecMt.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2Enc.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2Enc.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma86.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma86Dec.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma86Enc.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaDec.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaDec.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaEnc.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaEnc.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaLib.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaLib.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/MtCoder.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/MtCoder.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/MtDec.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/MtDec.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Ppmd.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Ppmd7.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Ppmd7.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Ppmd7Dec.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Ppmd7Enc.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Precomp.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/RotateDefs.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Sha256.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Sha256.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Sort.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Sort.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Threads.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Threads.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/7z/7zMain.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/7z/Precomp.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/7z/Precomp.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/LzmaLib/LzmaLibExports.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/Precomp.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/Precomp.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Xz.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/Xz.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/XzCrc64.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/XzCrc64.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/XzCrc64Opt.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/XzDec.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/XzEnc.c Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/XzEnc.h Examining data/mgba-0.8.4+dfsg/src/third-party/lzma/XzIn.c Examining data/mgba-0.8.4+dfsg/src/util/circle-buffer.c Examining data/mgba-0.8.4+dfsg/src/util/crc32.c Examining data/mgba-0.8.4+dfsg/src/util/elf-read.c Examining data/mgba-0.8.4+dfsg/src/util/export.c Examining data/mgba-0.8.4+dfsg/src/util/formatting.c Examining data/mgba-0.8.4+dfsg/src/util/gbk-table.c Examining data/mgba-0.8.4+dfsg/src/util/gui.c Examining data/mgba-0.8.4+dfsg/src/util/gui/file-select.c Examining data/mgba-0.8.4+dfsg/src/util/gui/font-metrics.c Examining data/mgba-0.8.4+dfsg/src/util/gui/font.c Examining data/mgba-0.8.4+dfsg/src/util/gui/menu.c Examining data/mgba-0.8.4+dfsg/src/util/hash.c Examining data/mgba-0.8.4+dfsg/src/util/patch-fast.c Examining data/mgba-0.8.4+dfsg/src/util/patch-ips.c Examining data/mgba-0.8.4+dfsg/src/util/patch-ups.c Examining data/mgba-0.8.4+dfsg/src/util/patch.c Examining data/mgba-0.8.4+dfsg/src/util/png-io.c Examining data/mgba-0.8.4+dfsg/src/util/ring-fifo.c Examining data/mgba-0.8.4+dfsg/src/util/string.c Examining data/mgba-0.8.4+dfsg/src/util/table.c Examining data/mgba-0.8.4+dfsg/src/util/test/string-parser.c Examining data/mgba-0.8.4+dfsg/src/util/test/suite.h Examining data/mgba-0.8.4+dfsg/src/util/test/text-codec.c Examining data/mgba-0.8.4+dfsg/src/util/test/vfs.c Examining data/mgba-0.8.4+dfsg/src/util/text-codec.c Examining data/mgba-0.8.4+dfsg/src/util/vfs.c Examining data/mgba-0.8.4+dfsg/src/util/vfs/vfs-devlist.c Examining data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c Examining data/mgba-0.8.4+dfsg/src/util/vfs/vfs-fd.c Examining data/mgba-0.8.4+dfsg/src/util/vfs/vfs-fifo.c Examining data/mgba-0.8.4+dfsg/src/util/vfs/vfs-file.c Examining data/mgba-0.8.4+dfsg/src/util/vfs/vfs-lzma.c Examining data/mgba-0.8.4+dfsg/src/util/vfs/vfs-mem.c Examining data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c Examining data/mgba-0.8.4+dfsg/src/util/configuration.c FINAL RESULTS: data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:36:24: [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. ssize_t size = readlink("/proc/self/exe", exePath, sizeof(exePath)); data/mgba-0.8.4+dfsg/include/mgba-util/common.h:54:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/mgba-0.8.4+dfsg/include/mgba-util/common.h:54:18: [4] (format) _snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/mgba-0.8.4+dfsg/include/mgba-util/gui/font.h:82:18: [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. ATTRIBUTE_FORMAT(printf, 6, 7) data/mgba-0.8.4+dfsg/include/mgba-util/gui/menu.h:75:18: [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. ATTRIBUTE_FORMAT(printf, 4, 5) data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/getopt.h:98:11: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)vfprintf(stderr,fmt,ap); data/mgba-0.8.4+dfsg/include/mgba/core/log.h:56:18: [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. ATTRIBUTE_FORMAT(printf, 3, 4) data/mgba-0.8.4+dfsg/include/mgba/internal/debugger/cli-debugger.h:74:19: [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. ATTRIBUTE_FORMAT(printf, 2, 3) data/mgba-0.8.4+dfsg/include/mgba/internal/debugger/cli-debugger.h:75:9: [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. void (*printf)(struct CLIDebuggerBackend*, const char* fmt, ...); data/mgba-0.8.4+dfsg/include/mgba/internal/debugger/cli-debugger.h:85:28: [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. struct CLIDebuggerSystem* system; data/mgba-0.8.4+dfsg/include/mgba/internal/gb/memory.h:127:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. uint8_t access; data/mgba-0.8.4+dfsg/include/mgba/internal/gb/serialize.h:372:13: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. uint8_t access; data/mgba-0.8.4+dfsg/opt/libgba/mgba.c:57:2: [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(REG_DEBUG_STRING, 0x100, ptr, args); data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:43:6: [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. be->printf(be, "%08X [%c%c%c%c%c%c%c]\n", psr.packed, data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:102:6: [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. be->printf(be, "%08X: ", address); data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:107:7: [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. be->printf(be, "%08X\t%s\n", instruction, disassembly); data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:118:8: [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. be->printf(be, "%04X %04X\t%s\n", instruction, instruction2, disassembly); data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:122:8: [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. be->printf(be, "%04X \t%s\n", instruction, disassembly); data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:133:7: [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. be->printf(be, "%sr%i: %08X %sr%i: %08X %sr%i: %08X %sr%i: %08X\n", data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:139:6: [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. be->printf(be, "cpsr: "); data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:154:7: [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. be->printf(be, "%s", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:160:22: [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. debugger->backend->printf(debugger->backend, INFO_BREAKPOINT_ADDED, id); data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:167:7: [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. be->printf(be, "%s", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:173:22: [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. debugger->backend->printf(debugger->backend, INFO_BREAKPOINT_ADDED, id); data/mgba-0.8.4+dfsg/src/core/input.c:215:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(keyValue, KEY_VALUE_MAX, "%" PRIi32, value); data/mgba-0.8.4+dfsg/src/core/log.c:77:3: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(format, args); data/mgba-0.8.4+dfsg/src/core/thread.c:643:2: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(format, args); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:168:42: [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. debugger->system->disassemble(debugger->system, dv); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:204:22: [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. debugger->backend->printf(debugger->backend, "Parse error\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:208:22: [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. debugger->backend->printf(debugger->backend, " $%02X:%04X\n", segmentValue, intValue); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:210:22: [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. debugger->backend->printf(debugger->backend, " %u\n", intValue); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:218:22: [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. debugger->backend->printf(debugger->backend, "Parse error\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:221:21: [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. debugger->backend->printf(debugger->backend, " 0b"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:224:22: [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. debugger->backend->printf(debugger->backend, "%u", (intValue >> i) & 1); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:226:21: [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. debugger->backend->printf(debugger->backend, "\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:233:22: [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. debugger->backend->printf(debugger->backend, "Parse error\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:236:21: [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. debugger->backend->printf(debugger->backend, " 0x%08X\n", intValue); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:242:22: [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. debugger->backend->printf(debugger->backend, "%-15s %s\n", commands[i].name, commands[i].summary); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:249:26: [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. debugger->backend->printf(debugger->backend, " Aliases:"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:252:25: [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. debugger->backend->printf(debugger->backend, " %s", aliases[j].name); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:256:24: [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. debugger->backend->printf(debugger->backend, "\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:266:23: [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. debugger->backend->printf(debugger->backend, " %s\n", commands[i].summary); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:273:27: [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. debugger->backend->printf(debugger->backend, " Aliases:"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:276:26: [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. debugger->backend->printf(debugger->backend, " %s", aliases[j].name); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:280:25: [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. debugger->backend->printf(debugger->backend, "\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:291:22: [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. debugger->backend->printf(debugger->backend, "Generic commands:\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:293:17: [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. if (debugger->system) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:294:23: [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. debugger->backend->printf(debugger->backend, "\n%s commands:\n", debugger->system->platformName); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:296:23: [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. debugger->backend->printf(debugger->backend, "\n%s commands:\n", debugger->system->name); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:301:17: [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. if (debugger->system) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:315:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:325:21: [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. debugger->backend->printf(debugger->backend, " 0x%02X\n", value); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:336:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:346:21: [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. debugger->backend->printf(debugger->backend, " 0x%04X\n", value); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:351:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:361:21: [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. debugger->backend->printf(debugger->backend, " 0x%08X\n", value); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:366:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:370:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_INVALID_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:376:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_OVERFLOW); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:388:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:392:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_INVALID_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:398:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_OVERFLOW); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:410:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:414:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_INVALID_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:418:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_INVALID_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:424:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:428:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_INVALID_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:442:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:455:22: [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. debugger->backend->printf(debugger->backend, "0x%08X:", address); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:463:23: [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. debugger->backend->printf(debugger->backend, " %02X", value); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:465:22: [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. debugger->backend->printf(debugger->backend, "\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:471:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:484:22: [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. debugger->backend->printf(debugger->backend, "0x%08X:", address); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:492:23: [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. debugger->backend->printf(debugger->backend, " %04X", value); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:494:22: [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. debugger->backend->printf(debugger->backend, "\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:500:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:513:22: [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. debugger->backend->printf(debugger->backend, "0x%08X:", address); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:521:23: [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. debugger->backend->printf(debugger->backend, " %08X", value); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:523:22: [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. debugger->backend->printf(debugger->backend, "\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:530:22: [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. debugger->backend->printf(debugger->backend, "Needs a filename\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:536:22: [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. debugger->backend->printf(debugger->backend, "Failed to load script\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:574:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:587:23: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_INVALID_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:593:22: [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. debugger->backend->printf(debugger->backend, INFO_BREAKPOINT_ADDED, id); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:599:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:603:22: [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. debugger->backend->printf(debugger->backend, "Watchpoints are not supported by this platform.\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:616:23: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_INVALID_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:622:22: [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. debugger->backend->printf(debugger->backend, INFO_WATCHPOINT_ADDED, id); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:644:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:660:23: [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. debugger->backend->printf(debugger->backend, "%" PRIz "i: %02X:%X\n", breakpoint->id, breakpoint->segment, breakpoint->address); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:662:23: [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. debugger->backend->printf(debugger->backend, "%" PRIz "i: 0x%X\n", breakpoint->id, breakpoint->address); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:677:23: [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. debugger->backend->printf(debugger->backend, "%" PRIz "i: %02X:%X\n", watchpoint->id, watchpoint->segment, watchpoint->address); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:679:23: [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. debugger->backend->printf(debugger->backend, "%" PRIz "i: 0x%X\n", watchpoint->id, watchpoint->address); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:687:22: [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. debugger->backend->printf(debugger->backend, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:705:43: [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. debugger->system->printStatus(debugger->system); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:721:22: [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. debugger->backend->printf(debugger->backend, "%s", trace); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:731:42: [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. debugger->system->printStatus(debugger->system); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:849:26: [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. debugger->backend->printf(debugger->backend, "Wrong number of arguments\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:884:26: [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. debugger->backend->printf(debugger->backend, "Parse error\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:907:24: [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. debugger->backend->printf(debugger->backend, "Wrong number of arguments\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:933:30: [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. if (result < 0 && debugger->system) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:940:22: [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. debugger->backend->printf(debugger->backend, "Command not found\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:980:27: [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. cliDebugger->backend->printf(cliDebugger->backend, "Hit breakpoint %" PRIz "i at 0x%08X\n", info->pointId, info->address); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:982:27: [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. cliDebugger->backend->printf(cliDebugger->backend, "Hit unknown breakpoint at 0x%08X\n", info->address); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:985:26: [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. cliDebugger->backend->printf(cliDebugger->backend, "Hit breakpoint\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:991:27: [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. cliDebugger->backend->printf(cliDebugger->backend, "Hit watchpoint %" PRIz "i at 0x%08X: (new value = 0x%08X, old value = 0x%08X)\n", info->pointId, info->address, info->type.wp.newValue, info->type.wp.oldValue); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:993:27: [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. cliDebugger->backend->printf(cliDebugger->backend, "Hit watchpoint %" PRIz "i at 0x%08X: (value = 0x%08X)\n", info->pointId, info->address, info->type.wp.oldValue); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:996:26: [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. cliDebugger->backend->printf(cliDebugger->backend, "Hit watchpoint\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1001:26: [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. cliDebugger->backend->printf(cliDebugger->backend, "Hit illegal opcode at 0x%08X: 0x%08X\n", info->address, info->type.bp.opcode); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1003:26: [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. cliDebugger->backend->printf(cliDebugger->backend, "Hit illegal opcode\n"); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1023:19: [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. if (cliDebugger->system) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1025:45: [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. cliDebugger->system->deinit(cliDebugger->system); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1027:21: [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. free(cliDebugger->system); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1044:19: [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. if (cliDebugger->system) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1045:53: [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. retain = cliDebugger->system->custom(cliDebugger->system) && retain; data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1064:86: [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. void CLIDebuggerAttachSystem(struct CLIDebugger* debugger, struct CLIDebuggerSystem* system) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1065:16: [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. if (debugger->system) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1067:39: [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. debugger->system->deinit(debugger->system); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1069:18: [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. free(debugger->system); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1072:21: [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. debugger->system = system; data/mgba-0.8.4+dfsg/src/feature/editline/cli-el-backend.c:40:18: [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. ATTRIBUTE_FORMAT(printf, 2, 3) data/mgba-0.8.4+dfsg/src/feature/editline/cli-el-backend.c:45:2: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, args); data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:273:2: [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(log, sizeof(log) - 1, format, args); data/mgba-0.8.4+dfsg/src/gb/debugger/cli.c:75:71: [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. struct GBCLIDebugger* gbDebugger = (struct GBCLIDebugger*) debugger->system; data/mgba-0.8.4+dfsg/src/gb/debugger/cli.c:84:7: [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. be->printf(be, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/gb/debugger/cli.c:90:7: [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. be->printf(be, "State %u out of range", state); data/mgba-0.8.4+dfsg/src/gb/debugger/cli.c:93:71: [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. struct GBCLIDebugger* gbDebugger = (struct GBCLIDebugger*) debugger->system; data/mgba-0.8.4+dfsg/src/gb/debugger/cli.c:101:7: [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. be->printf(be, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/gb/debugger/cli.c:107:7: [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. be->printf(be, "State %u out of range", state); data/mgba-0.8.4+dfsg/src/gb/debugger/cli.c:110:71: [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. struct GBCLIDebugger* gbDebugger = (struct GBCLIDebugger*) debugger->system; data/mgba-0.8.4+dfsg/src/gb/debugger/debugger.c:32:6: [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. be->printf(be, "IE: %02X IF: %02X IME: %i\n", gb->memory.ie, gb->memory.io[REG_IF], gb->memory.ime); data/mgba-0.8.4+dfsg/src/gb/debugger/debugger.c:33:6: [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. be->printf(be, "LCDC: %02X STAT: %02X LY: %02X\n", gb->memory.io[REG_LCDC], gb->memory.io[REG_STAT] | 0x80, gb->memory.io[REG_LY]); data/mgba-0.8.4+dfsg/src/gb/debugger/debugger.c:34:6: [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. be->printf(be, "Next video mode: %i\n", mTimingUntil(&gb->timing, &gb->video.modeEvent) / 4); data/mgba-0.8.4+dfsg/src/gb/mbc.c:693:29: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. gb->memory.mbcState.mbc7.access |= 1; data/mgba-0.8.4+dfsg/src/gb/mbc.c:702:29: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. gb->memory.mbcState.mbc7.access |= 2; data/mgba-0.8.4+dfsg/src/gb/mbc.c:704:29: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. gb->memory.mbcState.mbc7.access &= ~2; data/mgba-0.8.4+dfsg/src/gb/mbc.c:719:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (mbc7->access != 3) { data/mgba-0.8.4+dfsg/src/gb/mbc.c:766:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (mbc7->access != 3) { data/mgba-0.8.4+dfsg/src/gb/memory.c:744:53: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. state->memory.mbc7.access = memory->mbcState.mbc7.access; data/mgba-0.8.4+dfsg/src/gb/memory.c:815:53: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. memory->mbcState.mbc7.access = state->memory.mbc7.access; data/mgba-0.8.4+dfsg/src/gba/debugger/cli.c:74:74: [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. struct GBACLIDebugger* gbaDebugger = (struct GBACLIDebugger*) debugger->system; data/mgba-0.8.4+dfsg/src/gba/debugger/cli.c:83:7: [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. be->printf(be, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/gba/debugger/cli.c:89:7: [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. be->printf(be, "State %u out of range", state); data/mgba-0.8.4+dfsg/src/gba/debugger/cli.c:92:74: [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. struct GBACLIDebugger* gbaDebugger = (struct GBACLIDebugger*) debugger->system; data/mgba-0.8.4+dfsg/src/gba/debugger/cli.c:102:7: [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. be->printf(be, "%s\n", ERROR_MISSING_ARGS); data/mgba-0.8.4+dfsg/src/gba/debugger/cli.c:108:7: [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. be->printf(be, "State %u out of range", state); data/mgba-0.8.4+dfsg/src/gba/debugger/cli.c:111:74: [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. struct GBACLIDebugger* gbaDebugger = (struct GBACLIDebugger*) debugger->system; data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:146:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buffer, sizeof(buffer), "%u" BINARY_EXT, streamId); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:245:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s", dir, path); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:247:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s/%s", dir, path); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:263:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s", dir, path); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:265:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s/%s", dir, path); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:284:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s", dir, path); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:286:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s/%s", dir, path); data/mgba-0.8.4+dfsg/src/platform/example/client-server/server.c:162:3: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(format, args); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.c:806:2: [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(message, sizeof(message), format, args); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro_core_options.h:317:16: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(values_buf[i], desc); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro_core_options.h:321:16: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(values_buf[i], values[default_index].value); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro_core_options.h:329:22: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(values_buf[i], values[j].value); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:217:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s%s", dir, PATH_SEP, path); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:231:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s%s", dir, PATH_SEP, path); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:248:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s%s", dir, PATH_SEP, path); data/mgba-0.8.4+dfsg/src/platform/python/log.c:11:2: [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(message, sizeof(message) - 1, format, args); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:177:24: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. message = QString().vsprintf(format, args); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:180:23: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. message = QString().vsprintf(format, args); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:183:85: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. QMetaObject::invokeMethod(controller, "crashed", Q_ARG(const QString&, QString().vsprintf(format, args))); data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerConsoleController.cpp:19:23: [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. m_backend.d.printf = printf; data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerConsoleController.cpp:56:33: [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. void DebuggerConsoleController::printf(struct CLIDebuggerBackend* be, const char* fmt, ...) { data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerConsoleController.cpp:61:22: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. self->log(QString().vsprintf(fmt, args)); data/mgba-0.8.4+dfsg/src/platform/qt/DebuggerConsoleController.h:38:14: [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. static void printf(struct CLIDebuggerBackend* be, const char* fmt, ...); data/mgba-0.8.4+dfsg/src/platform/qt/SettingsView.cpp:494:105: [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. if (language != m_controller->getQtOption("language").toLocale() && !(language.bcp47Name() == QLocale::system().bcp47Name() && m_controller->getQtOption("language").isNull())) { data/mgba-0.8.4+dfsg/src/platform/switch/main.c:948:4: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buffer[1], size + strlen(arg0), buffer[0], arg0); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:24:6: [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. be->printf(be, "F: [%c%c%c%c]\n", data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:64:7: [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. be->printf(be, "%02X:", segment); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:66:6: [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. be->printf(be, "%04X: ", address); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:78:6: [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. be->printf(be, "%s\n", disassembly); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:85:6: [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. be->printf(be, "A: %02X F: %02X (AF: %04X)\n", cpu->a, cpu->f.packed, cpu->af); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:86:6: [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. be->printf(be, "B: %02X C: %02X (BC: %04X)\n", cpu->b, cpu->c, cpu->bc); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:87:6: [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. be->printf(be, "D: %02X E: %02X (DE: %04X)\n", cpu->d, cpu->e, cpu->de); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:88:6: [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. be->printf(be, "H: %02X L: %02X (HL: %04X)\n", cpu->h, cpu->l, cpu->hl); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:89:6: [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. be->printf(be, "PC: %04X SP: %04X\n", cpu->pc, cpu->sp); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:95:7: [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. be->printf(be, "%s%s: %02X", i ? " " : "", platDebugger->segments[i].name, cpu->memory.currentSegment(cpu, platDebugger->segments[i].start)); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:98:7: [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. be->printf(be, "\n"); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:52:19: [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. int fileLen = snprintf( data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:74:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(desktopFilePath, desktopFilename); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:91:9: [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. if (system(xdgMimeCommand) < 0) { data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:100:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(command, "xdg-open steam://rungameid/%s", steamId); data/mgba-0.8.4+dfsg/src/third-party/lzma/DllSecur.c:100:7: [4] (buffer) lstrcatW: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). lstrcatW(buf, L".dll"); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c:35:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, message); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:194:7: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. wcscpy(path + len, fd.cFileName); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:197:9: [4] (buffer) wcscat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). wcscat(path, WSTRING_PATH_SEPARATOR); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:338:9: [4] (buffer) wcscat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). wcscat(path, WSTRING_PATH_SEPARATOR); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:350:5: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. wcscpy(workCurDir, path); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:591:7: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. wcscpy(cmdLine, path); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:592:7: [4] (buffer) wcscat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). wcscat(cmdLine, cmdLineParams); data/mgba-0.8.4+dfsg/src/util/gui/font.c:62:2: [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), text, args); data/mgba-0.8.4+dfsg/src/util/gui/menu.c:206:2: [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(message, sizeof(message) - 1, format, args); data/mgba-0.8.4+dfsg/src/util/vfs.c:258:8: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(separator, path, &increment, &nlen) < 1) { data/mgba-0.8.4+dfsg/src/util/vfs/vfs-devlist.c:77:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(vdl->vde.name, "%s:", devops->name); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:103:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s%s", dir, PATH_SEP, path); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:117:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s%s", dir, PATH_SEP, path); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:134:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s%s", dir, PATH_SEP, path); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:160:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(combined, "%s%s%s", dir, PATH_SEP, vdede->ent->d_name); data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/getopt.h:174:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt(int nargc, char * const *nargv, const char *options) data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/getopt.h:396:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/getopt.h:568:1: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long(int nargc, char * const *nargv, const char *options, data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/threading.h:21:2: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(mutex); data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/threading.h:31:2: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(mutex); data/mgba-0.8.4+dfsg/src/core/config.c:240:24: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char* xdgConfigHome = getenv("XDG_CONFIG_HOME"); data/mgba-0.8.4+dfsg/src/core/config.c:246:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char* home = getenv("HOME"); data/mgba-0.8.4+dfsg/src/feature/commandline.c:88:15: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((ch = getopt_long(argc, argv, options, _options, &index)) != -1) { data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-audio.c:23:7: [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 (!getenv("SDL_AUDIODRIVER")) { data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/connection_unix.cpp:31:24: [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* temp = getenv("XDG_RUNTIME_DIR"); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/connection_unix.cpp:32:26: [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. temp = temp ? temp : getenv("TMPDIR"); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/connection_unix.cpp:33:26: [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. temp = temp ? temp : getenv("TMP"); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/connection_unix.cpp:34:26: [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. temp = temp ? temp : getenv("TEMP"); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:29:24: [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* home = getenv("HOME"); data/mgba-0.8.4+dfsg/src/third-party/lzma/Threads.c:88:5: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(p); data/mgba-0.8.4+dfsg/src/third-party/lzma/Threads.h:63:34: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. #define CriticalSection_Enter(p) EnterCriticalSection(p) data/mgba-0.8.4+dfsg/include/mgba-util/gui.h:79:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char currentPath[PATH_MAX]; data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/getopt.h:159:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((char **) nargv)[pos] = nargv[cstart]; data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/getopt.h:161:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((char **)nargv)[cstart] = swap; data/mgba-0.8.4+dfsg/include/mgba-util/vector.h:95:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dest->vector, src->vector, src->size * sizeof(TYPE)); \ data/mgba-0.8.4+dfsg/include/mgba/core/directories.h:17:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char baseName[PATH_MAX]; data/mgba-0.8.4+dfsg/include/mgba/core/library.h:20:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char internalTitle[17]; data/mgba-0.8.4+dfsg/include/mgba/core/library.h:21:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char internalCode[9]; data/mgba-0.8.4+dfsg/include/mgba/internal/debugger/gdb-stub.h:30:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[GDB_STUB_MAX_LINE]; data/mgba-0.8.4+dfsg/include/mgba/internal/debugger/gdb-stub.h:31:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char outgoing[GDB_STUB_MAX_LINE]; data/mgba-0.8.4+dfsg/include/mgba/internal/gb/gb.h:130:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char titleLong[16]; data/mgba-0.8.4+dfsg/include/mgba/internal/gb/gb.h:132:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char titleShort[11]; data/mgba-0.8.4+dfsg/include/mgba/internal/gb/gb.h:133:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char maker[4]; data/mgba-0.8.4+dfsg/include/mgba/internal/gb/gb.h:137:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char licensee[2]; data/mgba-0.8.4+dfsg/include/mgba/internal/gb/serialize.h:276:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char title[16]; data/mgba-0.8.4+dfsg/include/mgba/internal/gba/gba.h:121:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char debugString[0x100]; data/mgba-0.8.4+dfsg/include/mgba/internal/gba/gba.h:128:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char title[12]; data/mgba-0.8.4+dfsg/include/mgba/internal/gba/memory.h:116:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char waitstatesSeq32[256]; data/mgba-0.8.4+dfsg/include/mgba/internal/gba/memory.h:117:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char waitstatesSeq16[256]; data/mgba-0.8.4+dfsg/include/mgba/internal/gba/memory.h:118:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char waitstatesNonseq32[256]; data/mgba-0.8.4+dfsg/include/mgba/internal/gba/memory.h:119:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char waitstatesNonseq16[256]; data/mgba-0.8.4+dfsg/include/mgba/internal/gba/overrides.h:18:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char id[4]; data/mgba-0.8.4+dfsg/include/mgba/internal/gba/serialize.h:240:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char title[12]; data/mgba-0.8.4+dfsg/src/arm/debugger/cli-debugger.c:100:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char disassembly[64]; data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:299:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char disassembly[64]; data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:304:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(disassembly, "%08X: ", instruction); data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:315:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(disassembly, "%04X%04X: ", instruction, instruction2); data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:318:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(disassembly, " %04X: ", instruction); data/mgba-0.8.4+dfsg/src/core/cheats.c:137:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cheat[MAX_LINE_LENGTH]; data/mgba-0.8.4+dfsg/src/core/cheats.c:228:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cheat[MAX_LINE_LENGTH]; data/mgba-0.8.4+dfsg/src/core/cheats.c:229:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[MAX_LINE_LENGTH]; data/mgba-0.8.4+dfsg/src/core/cheats.c:334:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cheat[MAX_LINE_LENGTH]; data/mgba-0.8.4+dfsg/src/core/cheats.c:335:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cheatName[MAX_LINE_LENGTH]; data/mgba-0.8.4+dfsg/src/core/cheats.c:336:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char miniline[32]; data/mgba-0.8.4+dfsg/src/core/cheats.c:447:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char lineStart[3] = "# "; data/mgba-0.8.4+dfsg/src/core/cheats.c:462:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char directive[64]; data/mgba-0.8.4+dfsg/src/core/config.c:148:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/core/config.c:155:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/core/config.c:172:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char out[MAX_PATH]; data/mgba-0.8.4+dfsg/src/core/config.c:173:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t wpath[MAX_PATH]; data/mgba-0.8.4+dfsg/src/core/config.c:174:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t wprojectName[MAX_PATH]; data/mgba-0.8.4+dfsg/src/core/config.c:175:2: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, projectName, -1, wprojectName, MAX_PATH); data/mgba-0.8.4+dfsg/src/core/config.c:185:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char out[PATH_MAX]; data/mgba-0.8.4+dfsg/src/core/config.c:199:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t wpath[MAX_PATH]; data/mgba-0.8.4+dfsg/src/core/config.c:200:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t wprojectName[MAX_PATH]; data/mgba-0.8.4+dfsg/src/core/config.c:201:2: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, projectName, -1, wprojectName, MAX_PATH); data/mgba-0.8.4+dfsg/src/core/core.c:32:18: [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). struct mCore* (*open)(void); data/mgba-0.8.4+dfsg/src/core/core.c:54:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (filter->open) { data/mgba-0.8.4+dfsg/src/core/core.c:55:18: [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). return filter->open(); data/mgba-0.8.4+dfsg/src/core/core.c:258:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[PATH_MAX + 14]; // Quash warning data/mgba-0.8.4+dfsg/src/core/core.c:264:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[PATH_MAX + 14]; // Quash warning data/mgba-0.8.4+dfsg/src/core/core.c:377:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(block, &bytes[phdr->p_offset], phdr->p_filesz); data/mgba-0.8.4+dfsg/src/core/directories.c:160:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dirname[PATH_MAX]; data/mgba-0.8.4+dfsg/src/core/directories.c:168:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[PATH_MAX + 1] = ""; data/mgba-0.8.4+dfsg/src/core/input.c:138:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char keyKey[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:150:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char axisKey[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:187:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hatKey[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:209:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char keyKey[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:214:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char keyValue[KEY_VALUE_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:221:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char axisKey[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:240:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char axisKey[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:248:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char axisInfo[AXIS_INFO_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:256:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char axisKey[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:264:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char axisInfo[AXIS_INFO_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:272:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hatKey[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:273:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hatValue[KEY_VALUE_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:578:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[SECTION_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:584:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[SECTION_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:590:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[SECTION_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:597:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[SECTION_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:604:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[SECTION_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:607:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char deviceId[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:613:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[SECTION_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:616:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char deviceId[KEY_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:622:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[SECTION_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/input.c:635:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[SECTION_NAME_MAX]; data/mgba-0.8.4+dfsg/src/core/interface.c:58:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(oldData, item->data, item->size); data/mgba-0.8.4+dfsg/src/core/interface.c:67:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, &state, sizeof(state)); data/mgba-0.8.4+dfsg/src/core/log.c:128:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char configName[128] = {0}; data/mgba-0.8.4+dfsg/src/core/map-cache.c:86:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(mapOut, tile, sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:87:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride], &tile[0x08], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:88:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 2], &tile[0x10], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:89:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 3], &tile[0x18], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:90:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 4], &tile[0x20], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:91:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 5], &tile[0x28], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:92:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 6], &tile[0x30], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:93:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 7], &tile[0x38], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:103:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 7], tile, sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:104:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 6], &tile[0x08], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:105:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 5], &tile[0x10], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:106:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 4], &tile[0x18], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:107:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 3], &tile[0x20], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:108:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride * 2], &tile[0x28], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:109:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mapOut[stride], &tile[0x30], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/core/map-cache.c:110:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(mapOut, &tile[0x38], sizeof(color_t) * 8); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:710:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char trace[1024]; data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1124:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char out[2] = { name[len], '\0' }; data/mgba-0.8.4+dfsg/src/debugger/symbols.c:54:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[512]; data/mgba-0.8.4+dfsg/src/feature/commandline.c:54:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char option[128] = ""; data/mgba-0.8.4+dfsg/src/feature/commandline.c:70:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char options[64] = data/mgba-0.8.4+dfsg/src/feature/commandline.c:127:21: [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). args->logLevel = atoi(optarg); data/mgba-0.8.4+dfsg/src/feature/commandline.c:133:22: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). args->frameskip = atoi(optarg); data/mgba-0.8.4+dfsg/src/feature/ffmpeg/ffmpeg-encoder.c:428:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char args[256]; data/mgba-0.8.4+dfsg/src/feature/gui/gui-config.c:25:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ext[PATH_MAX + 1] = {}; data/mgba-0.8.4+dfsg/src/feature/gui/gui-config.c:186:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char gbaBiosPath[256] = ""; data/mgba-0.8.4+dfsg/src/feature/gui/gui-config.c:188:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char gbBiosPath[256] = ""; data/mgba-0.8.4+dfsg/src/feature/gui/gui-config.c:189:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char gbcBiosPath[256] = ""; data/mgba-0.8.4+dfsg/src/feature/gui/gui-config.c:190:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sgbBiosPath[256] = ""; data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:78:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ext[PATH_MAX] = {}; data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:207:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:272:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char log[256] = {0}; data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:274:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char log2[256] = {0}; data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:280:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:655:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/feature/gui/remap.c:19:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&keyNames[1], keys->keyNames, keys->nKeys * sizeof(keyNames[0])); data/mgba-0.8.4+dfsg/src/feature/sqlite3/no-intro.c:83:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[512]; data/mgba-0.8.4+dfsg/src/feature/video-logger.c:31:18: [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). struct mCore* (*open)(void); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:66:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char magic[4]; data/mgba-0.8.4+dfsg/src/feature/video-logger.c:638:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(context->initialState, mem, context->initialStateSize); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:766:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(extendedState, context->initialState, context->initialStateSize); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:1059:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (descriptor->open) { data/mgba-0.8.4+dfsg/src/feature/video-logger.c:1060:22: [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). core = descriptor->open(); data/mgba-0.8.4+dfsg/src/gb/core.c:410:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, &gb->romCrc32, sizeof(gb->romCrc32)); data/mgba-0.8.4+dfsg/src/gb/core.c:493:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/gb/core.c:835:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*sram, gb->memory.sram, gb->sramSize); data/mgba-0.8.4+dfsg/src/gb/core.c:858:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gb->memory.sram, sram, size); data/mgba-0.8.4+dfsg/src/gb/debugger/symbols.c:13:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[512]; data/mgba-0.8.4+dfsg/src/gb/extra/proxy.c:72:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(proxyRenderer->logger->oam, &proxyRenderer->d.oam->raw, GB_SIZE_OAM); data/mgba-0.8.4+dfsg/src/gb/extra/proxy.c:73:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(proxyRenderer->logger->vram, proxyRenderer->d.vram, GB_SIZE_VRAM); data/mgba-0.8.4+dfsg/src/gb/gb.c:210:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(newSram, gb->memory.sram, gb->sramSize); data/mgba-0.8.4+dfsg/src/gb/gb.c:213:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(newSram, gb->memory.sram, size); data/mgba-0.8.4+dfsg/src/gb/gb.c:575:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&gb->memory.romBase[size], &oldRomBase[size], GB_SIZE_CART_BANK0 - size); data/mgba-0.8.4+dfsg/src/gb/gb.c:577:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&gb->memory.romBase[0x100], &oldRomBase[0x100], sizeof(struct GBCartridge)); data/mgba-0.8.4+dfsg/src/gb/gb.c:822:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, cart->titleLong, 16); data/mgba-0.8.4+dfsg/src/gb/gb.c:824:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, cart->titleShort, 11); data/mgba-0.8.4+dfsg/src/gb/gb.c:838:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, "CGB-????", 8); data/mgba-0.8.4+dfsg/src/gb/gb.c:840:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, "DMG-????", 8); data/mgba-0.8.4+dfsg/src/gb/gb.c:843:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&out[4], cart->maker, 4); data/mgba-0.8.4+dfsg/src/gb/io.c:692:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->io, gb->memory.io, GB_SIZE_IO); data/mgba-0.8.4+dfsg/src/gb/io.c:697:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gb->memory.io, state->io, GB_SIZE_IO); data/mgba-0.8.4+dfsg/src/gb/memory.c:704:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->wram, memory->wram, GB_SIZE_WORKING_RAM); data/mgba-0.8.4+dfsg/src/gb/memory.c:705:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->hram, memory->hram, GB_SIZE_HRAM); data/mgba-0.8.4+dfsg/src/gb/memory.c:761:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(memory->wram, state->wram, GB_SIZE_WORKING_RAM); data/mgba-0.8.4+dfsg/src/gb/memory.c:762:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(memory->hram, state->hram, GB_SIZE_HRAM); data/mgba-0.8.4+dfsg/src/gb/memory.c:779:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(memory->rtcRegs, state->memory.rtcRegs, sizeof(state->memory.rtcRegs)); data/mgba-0.8.4+dfsg/src/gb/memory.c:840:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(newRom, gb->memory.rom, gb->memory.romSize); data/mgba-0.8.4+dfsg/src/gb/overrides.c:529:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[24] = ""; data/mgba-0.8.4+dfsg/src/gb/overrides.c:588:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[24] = ""; data/mgba-0.8.4+dfsg/src/gb/renderers/software.c:103:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(block, &renderer->sgbPacket[start], 6); data/mgba-0.8.4+dfsg/src/gb/renderers/software.c:324:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(renderer->sgbAttributes, &renderer->sgbAttributeFiles[set * 90], 90); data/mgba-0.8.4+dfsg/src/gb/serialize.c:270:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gb->video.sgbPacketBuffer, state->sgb.packet, sizeof(state->sgb.packet)); data/mgba-0.8.4+dfsg/src/gb/serialize.c:271:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gb->sgbPacket, state->sgb.inProgressPacket, sizeof(state->sgb.inProgressPacket)); data/mgba-0.8.4+dfsg/src/gb/serialize.c:289:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gb->video.renderer->sgbCharRam, state->sgb.charRam, sizeof(state->sgb.charRam)); data/mgba-0.8.4+dfsg/src/gb/serialize.c:290:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gb->video.renderer->sgbMapRam, state->sgb.mapRam, sizeof(state->sgb.mapRam)); data/mgba-0.8.4+dfsg/src/gb/serialize.c:291:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gb->video.renderer->sgbPalRam, state->sgb.palRam, sizeof(state->sgb.palRam)); data/mgba-0.8.4+dfsg/src/gb/serialize.c:292:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gb->video.renderer->sgbAttributeFiles, state->sgb.atfRam, sizeof(state->sgb.atfRam)); data/mgba-0.8.4+dfsg/src/gb/serialize.c:293:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gb->video.renderer->sgbAttributes, state->sgb.attributes, sizeof(state->sgb.attributes)); data/mgba-0.8.4+dfsg/src/gb/sio/printer.c:220:6: [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, lineBuffer, sizeof(lineBuffer)); data/mgba-0.8.4+dfsg/src/gb/video.c:590:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&video->sgbPacketBuffer[video->sgbBufferIndex << 4], data, 16); data/mgba-0.8.4+dfsg/src/gb/video.c:828:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->vram, video->vram, GB_SIZE_VRAM); data/mgba-0.8.4+dfsg/src/gb/video.c:829:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->oam, &video->oam.raw, GB_SIZE_OAM); data/mgba-0.8.4+dfsg/src/gb/video.c:882:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(video->vram, state->vram, GB_SIZE_VRAM); data/mgba-0.8.4+dfsg/src/gb/video.c:883:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&video->oam.raw, state->oam, GB_SIZE_OAM); data/mgba-0.8.4+dfsg/src/gba/cheats.c:139:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[18] = "XXXXXXXX XXXXXXXX"; data/mgba-0.8.4+dfsg/src/gba/cheats/codebreaker.c:190:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[14] = "XXXXXXXX XXXX"; data/mgba-0.8.4+dfsg/src/gba/cheats/gameshark.c:82:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cheats->gsaSeeds, GBACheatGameSharkSeeds, 4 * sizeof(uint32_t)); data/mgba-0.8.4+dfsg/src/gba/cheats/gameshark.c:86:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cheats->gsaSeeds, GBACheatProActionReplaySeeds, 4 * sizeof(uint32_t)); data/mgba-0.8.4+dfsg/src/gba/cheats/gameshark.c:231:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[18] = "XXXXXXXX XXXXXXXX"; data/mgba-0.8.4+dfsg/src/gba/cheats/parv3.c:341:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[18] = "XXXXXXXX XXXXXXXX"; data/mgba-0.8.4+dfsg/src/gba/core.c:516:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, &gba->romCrc32, sizeof(gba->romCrc32)); data/mgba-0.8.4+dfsg/src/gba/core.c:598:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/gba/extra/proxy.c:81:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(proxyRenderer->logger->oam, &proxyRenderer->d.oam->raw, SIZE_OAM); data/mgba-0.8.4+dfsg/src/gba/extra/proxy.c:82:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(proxyRenderer->logger->palette, proxyRenderer->d.palette, SIZE_PALETTE_RAM); data/mgba-0.8.4+dfsg/src/gba/extra/proxy.c:83:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(proxyRenderer->logger->vram, proxyRenderer->d.vram, SIZE_VRAM); data/mgba-0.8.4+dfsg/src/gba/gba.c:420:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(newRom, gba->memory.rom, gba->pristineRomSize); data/mgba-0.8.4+dfsg/src/gba/gba.c:545:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char oolBuf[0x101]; data/mgba-0.8.4+dfsg/src/gba/gba.c:710:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, "AGB-", 4); data/mgba-0.8.4+dfsg/src/gba/gba.c:711:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&out[4], &((struct GBACartridge*) gba->memory.rom)->id, 4); data/mgba-0.8.4+dfsg/src/gba/gba.c:716:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, &((struct GBACartridge*) gba->memory.rom)->title, 12); data/mgba-0.8.4+dfsg/src/gba/gba.c:720:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, &((struct GBACartridge*) gba->memory.wram)->title, 12); data/mgba-0.8.4+dfsg/src/gba/memory.c:33:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char GBA_BASE_WAITSTATES[16] = { 0, 0, 2, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4 }; data/mgba-0.8.4+dfsg/src/gba/memory.c:34:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char GBA_BASE_WAITSTATES_32[16] = { 0, 0, 5, 0, 0, 1, 1, 0, 7, 7, 9, 9, 13, 13, 9 }; data/mgba-0.8.4+dfsg/src/gba/memory.c:35:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char GBA_BASE_WAITSTATES_SEQ[16] = { 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 4, 4, 8, 8, 4 }; data/mgba-0.8.4+dfsg/src/gba/memory.c:36:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char GBA_BASE_WAITSTATES_SEQ_32[16] = { 0, 0, 5, 0, 0, 1, 1, 0, 5, 5, 9, 9, 17, 17, 9 }; data/mgba-0.8.4+dfsg/src/gba/memory.c:1656:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->wram, memory->wram, SIZE_WORKING_RAM); data/mgba-0.8.4+dfsg/src/gba/memory.c:1657:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->iwram, memory->iwram, SIZE_WORKING_IRAM); data/mgba-0.8.4+dfsg/src/gba/memory.c:1661:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(memory->wram, state->wram, SIZE_WORKING_RAM); data/mgba-0.8.4+dfsg/src/gba/memory.c:1662:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(memory->iwram, state->iwram, SIZE_WORKING_IRAM); data/mgba-0.8.4+dfsg/src/gba/memory.c:1671:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(newRom, gba->memory.rom, gba->memory.romSize); data/mgba-0.8.4+dfsg/src/gba/memory.c:1692:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char oolBuf[0x101]; data/mgba-0.8.4+dfsg/src/gba/memory.c:1723:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&memory->rom[AGB_PRINT_FLUSH_ADDR >> 2], _agbPrintFunc, sizeof(_agbPrintFunc)); data/mgba-0.8.4+dfsg/src/gba/overrides.c:220:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[16]; data/mgba-0.8.4+dfsg/src/gba/overrides.c:270:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sectionName[16]; data/mgba-0.8.4+dfsg/src/gba/renderers/gl.c:835:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char log[2048]; data/mgba-0.8.4+dfsg/src/gba/renderers/video-software.c:524:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(softwareRenderer->cache[y].io, softwareRenderer->nextIo, sizeof(softwareRenderer->nextIo)); data/mgba-0.8.4+dfsg/src/gba/renderers/video-software.c:687:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(row, softwareRenderer->row, GBA_VIDEO_HORIZONTAL_PIXELS * sizeof(*row)); data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:145:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[14]; data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:395:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4]; data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:184:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[8761]; data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:229:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char magic[4]; data/mgba-0.8.4+dfsg/src/gba/sharkport.c:16:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char c[0x1C]; data/mgba-0.8.4+dfsg/src/gba/sharkport.c:81:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer.c, &cart->title, 16); data/mgba-0.8.4+dfsg/src/gba/sharkport.c:143:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(gba->memory.savedata.data, &payload[0x1C], copySize); data/mgba-0.8.4+dfsg/src/gba/sharkport.c:159:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char c[0x1C]; data/mgba-0.8.4+dfsg/src/gba/sharkport.c:213:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer.c, &cart->title, 16); data/mgba-0.8.4+dfsg/src/gba/vfame.c:36:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char INIT_SEQUENCE[16] = { 0xB4, 0x00, 0x9F, 0xE5, 0x99, 0x10, 0xA0, 0xE3, 0x00, 0x10, 0xC0, 0xE5, 0xAC, 0x00, 0x9F, 0xE5 }; data/mgba-0.8.4+dfsg/src/gba/video.c:302:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->vram, video->vram, SIZE_VRAM); data/mgba-0.8.4+dfsg/src/gba/video.c:303:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->oam, video->oam.raw, SIZE_OAM); data/mgba-0.8.4+dfsg/src/gba/video.c:304:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->pram, video->palette, SIZE_PALETTE_RAM); data/mgba-0.8.4+dfsg/src/gba/video.c:310:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(video->vram, state->vram, SIZE_VRAM); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:22:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char utf8Name[256]; data/mgba-0.8.4+dfsg/src/platform/3ds/main.c:617:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&screenshotBuffer[y * 256], &pixels[y * width], width * sizeof(color_t)); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.c:549:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, game->data, game->size); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.c:591:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char biosPath[PATH_MAX]; data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.c:805:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char message[128]; data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.c:924:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&camData[camStride * i], &buffer[pitch * i / sizeof(*buffer)], pitch); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.h:1386:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). retro_vfs_open_t open; data/mgba-0.8.4+dfsg/src/platform/libretro/libretro_core_options.h:318:16: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(values_buf[i], "; "); data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.c:494:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char log[1024]; data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.c:645:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fieldName[16]; data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.c:927:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char passName[12]; data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.c:984:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(uniformBlock, mGLES2UniformListGetPointer(&uniformVector, 0), sizeof(*uniformBlock) * u); data/mgba-0.8.4+dfsg/src/platform/psp2/gui-font.c:44:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char base[5] = { 0 }; data/mgba-0.8.4+dfsg/src/platform/psp2/gui-font.c:69:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char base[5] = { 0 }; data/mgba-0.8.4+dfsg/src/platform/psp2/psp2-context.c:623:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&texpixels[256 * y], &pixels[width * y], width * 4); data/mgba-0.8.4+dfsg/src/platform/python/log.c:10:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char message[256] = {0}; data/mgba-0.8.4+dfsg/src/platform/qt/AboutScreen.cpp:32:13: [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). patronFile.open(QIODevice::ReadOnly | QIODevice::Text); data/mgba-0.8.4+dfsg/src/platform/qt/AbstractUpdater.cpp:77:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { data/mgba-0.8.4+dfsg/src/platform/qt/AssetView.cpp:109:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&pixels[base + i * stride], &tile[i * 8], 8); data/mgba-0.8.4+dfsg/src/platform/qt/AssetView.cpp:126:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(static_cast<void*>(&bgBits[tilesW * 32 * (i + j * 8)]), mMapCacheGetRow(mapCache, i + j * 8), tilesW * 32); data/mgba-0.8.4+dfsg/src/platform/qt/BattleChipModel.cpp:110:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file.open(QIODevice::ReadOnly | QIODevice::Text); data/mgba-0.8.4+dfsg/src/platform/qt/BattleChipView.cpp:33:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char title[9]; data/mgba-0.8.4+dfsg/src/platform/qt/CheatsModel.cpp:211:27: [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). VFile* vf = VFileDevice::open(path, O_RDONLY); data/mgba-0.8.4+dfsg/src/platform/qt/CheatsModel.cpp:223:27: [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). VFile* vf = VFileDevice::open(path, O_TRUNC | O_CREAT | O_WRONLY); data/mgba-0.8.4+dfsg/src/platform/qt/ColorPicker.cpp:59:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). colorPicker->open(); data/mgba-0.8.4+dfsg/src/platform/qt/ConfigController.cpp:302:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:516:28: [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). VFile* vf = VFileDevice::open(controller->m_statePath, O_RDONLY); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:552:28: [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). VFile* vf = VFileDevice::open(controller->m_statePath, O_RDONLY); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:558:21: [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). vf = VFileDevice::open(controller->m_statePath, O_WRONLY | O_CREAT | O_TRUNC); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:603:28: [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). VFile* vf = VFileDevice::open(path, temporary ? O_RDONLY : O_RDWR); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:620:30: [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). VFile* patch = VFileDevice::open(patchPath, O_RDONLY); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:704:27: [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). VFile* vf = VFileDevice::open(path, O_RDONLY); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:720:27: [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). VFile* vf = VFileDevice::open(path, O_WRONLY | O_CREAT | O_TRUNC); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:838:27: [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). VFile* vf = VFileDevice::open(path, O_WRONLY | O_CREAT | O_TRUNC); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:909:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(m_completeBuffer.data(), m_activeBuffer.constData(), 256 * height * BYTES_PER_PIXEL); data/mgba-0.8.4+dfsg/src/platform/qt/DisplayGL.cpp:510:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, backing, size.width() * size.height() * BYTES_PER_PIXEL); data/mgba-0.8.4+dfsg/src/platform/qt/GBAApp.cpp:301:27: [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). VFile* vf = VFileDevice::open(GBAApp::dataDir() + "/nointro.dat", O_RDONLY); data/mgba-0.8.4+dfsg/src/platform/qt/GBAOverride.cpp:23:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char gameId[8]; data/mgba-0.8.4+dfsg/src/platform/qt/GBAOverride.cpp:25:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(override.id, &gameId[4], 4); data/mgba-0.8.4+dfsg/src/platform/qt/InputController.cpp:275:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[34] = {0}; data/mgba-0.8.4+dfsg/src/platform/qt/LogController.cpp:140:13: [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). m_logFile->open(QIODevice::Append | QIODevice::Text); data/mgba-0.8.4+dfsg/src/platform/qt/MapView.cpp:226:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(static_cast<void*>(&bgBits[width * j * 4]), mBitmapCacheGetRow(bitmapCache, j), width * 4); data/mgba-0.8.4+dfsg/src/platform/qt/MemoryDump.cpp:29:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!outfile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { data/mgba-0.8.4+dfsg/src/platform/qt/MemoryModel.cpp:143:27: [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). VFile* vf = VFileDevice::open(path, O_RDONLY); data/mgba-0.8.4+dfsg/src/platform/qt/MemoryModel.cpp:212:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!outfile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { data/mgba-0.8.4+dfsg/src/platform/qt/MemoryModel.cpp:226:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!infile.open(QIODevice::ReadOnly)) { data/mgba-0.8.4+dfsg/src/platform/qt/MemoryModel.cpp:248:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char leDatum[2]; data/mgba-0.8.4+dfsg/src/platform/qt/MemoryModel.cpp:256:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char leDatum[4]; data/mgba-0.8.4+dfsg/src/platform/qt/MemoryModel.cpp:276:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char leDatum[2]{ bytes[i], bytes[i + 1] }; data/mgba-0.8.4+dfsg/src/platform/qt/MemoryModel.cpp:284:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char leDatum[4]{ bytes[i], bytes[i + 1], bytes[i + 2], bytes[i + 3] }; data/mgba-0.8.4+dfsg/src/platform/qt/PaletteView.cpp:140:27: [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). VFile* vf = VFileDevice::open(filename, O_WRONLY | O_CREAT | O_TRUNC); data/mgba-0.8.4+dfsg/src/platform/qt/ROMInfo.cpp:36:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char title[17] = {}; data/mgba-0.8.4+dfsg/src/platform/qt/VFileDevice.cpp:60:21: [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). VFile* VFileDevice::open(const QString& path, int mode) { data/mgba-0.8.4+dfsg/src/platform/qt/VFileDevice.h:30:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). static VFile* open(const QString& path, int mode); data/mgba-0.8.4+dfsg/src/platform/qt/Window.cpp:1016:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char gameTitle[17] = { '\0' }; data/mgba-0.8.4+dfsg/src/platform/sdl/pandora-sdl.c:39:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). renderer->fb = open("/dev/fb1", O_RDWR); data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-events.c:205:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char joystickName[34] = {0}; data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-events.c:262:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[34] = {0}; data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-events.c:317:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[34] = {0}; data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-events.c:325:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char value[16]; data/mgba-0.8.4+dfsg/src/platform/sdl/sdl-events.c:378:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char joystickName[34] = {0}; data/mgba-0.8.4+dfsg/src/platform/switch/main.c:334:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[0], &vibrationStop, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:335:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[1], &vibrationStop, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:336:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[2], &vibrationStop, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:337:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[3], &vibrationStop, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:470:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[0], &rumble.value, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:471:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[1], &rumble.value, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:472:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[2], &rumble.value, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:473:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[3], &rumble.value, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:475:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[0], &vibrationStop, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:476:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[1], &vibrationStop, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:477:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[2], &vibrationStop, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:478:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&values[3], &vibrationStop, sizeof(rumble.value)); data/mgba-0.8.4+dfsg/src/platform/test/perf-main.c:192:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char gameCode[9] = { 0 }; data/mgba-0.8.4+dfsg/src/platform/test/perf-main.c:242:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[256]; data/mgba-0.8.4+dfsg/src/platform/test/perf-main.c:324:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/platform/wii/gui-font.c:35:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fontTpl, font, font_size); data/mgba-0.8.4+dfsg/src/platform/wii/gui-font.c:44:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(iconsTpl, icons, icons_size); data/mgba-0.8.4+dfsg/src/platform/wii/main.c:907:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(interframeTexmem, texmem, TEX_W * TEX_H * BYTES_PER_PIXEL); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:39:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t name[MAX_PATH + 1]; data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:40:2: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, path, -1, name, MAX_PATH); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:86:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t name[MAX_PATH + 1]; data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:87:2: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, vdw->path, -1, name, MAX_PATH); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:147:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t dir[MAX_PATH + 1]; data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:148:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t pathw[MAX_PATH + 1]; data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:149:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t combined[MAX_PATH + 1]; data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:150:2: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, vdw->path, -1, dir, MAX_PATH); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:151:2: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, path, -1, pathw, MAX_PATH); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:177:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t wpath[MAX_PATH]; data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:178:2: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, MAX_PATH); data/mgba-0.8.4+dfsg/src/sm83/debugger/cli-debugger.c:61:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char disassembly[48]; data/mgba-0.8.4+dfsg/src/sm83/debugger/debugger.c:204:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char disassembly[64]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:34:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char exePath[1024]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:51:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char desktopFile[2048]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:58:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char desktopFilename[256]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:61:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char desktopFilePath[1024]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:66:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(desktopFilePath, "/share"); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:70:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(desktopFilePath, "/applications"); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:76:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* fp = fopen(desktopFilePath, "w"); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:85:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xdgMimeCommand[1024]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_linux.cpp:99:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char command[256]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:75:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t exeFilePath[MAX_PATH]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:77:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t openCommand[1024]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:87:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t protocolName[64]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:89:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t protocolDescription[128]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:94:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t keyName[256]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:135:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t appId[32]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:136:5: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, applicationId, -1, appId, 32); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:138:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t openCommand[1024]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:142:9: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, command, -1, openCommand, commandBufferLen); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:152:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t appId[32]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:153:5: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, applicationId, -1, appId, 32); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:155:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t wSteamId[32]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:156:5: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, steamId, -1, wSteamId, 32); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:165:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t steamPath[MAX_PATH]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_register_win.cpp:181:5: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t command[1024]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:24:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[MaxMessageSize]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:30:13: [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, other.buffer, length); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:38:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char userId[32]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:41:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char username[344]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:43:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char discriminator[8]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:45:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char avatar[128]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:58:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char JoinGameSecret[256]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:59:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char SpectateGameSecret[256]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:61:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char LastErrorMessage[256]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/discord_rpc.cpp:63:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char LastDisconnectErrorMessage[256]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/rpc_connection.cpp:72:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sendFrame.message, data, length); data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/rpc_connection.h:31:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char message[MaxRpcFrameSize - sizeof(MessageFrameHeader)]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/rpc_connection.h:45:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char appId[64]{}; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/rpc_connection.h:47:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lastErrorMessage[256]{}; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/serialization.cpp:17:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char temp[32]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/serialization.cpp:78:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nonceBuffer[32]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/serialization.h:103:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fixedBuffer_[Size]; data/mgba-0.8.4+dfsg/src/third-party/discord-rpc/src/serialization.h:165:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parseBuffer_[32 * 1024]; data/mgba-0.8.4+dfsg/src/third-party/lzma/7zArcIn.c:19:38: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. { MY_ALLOC(Byte, to, size, alloc); memcpy(to, from, size); } data/mgba-0.8.4+dfsg/src/third-party/lzma/7zBuf2.c:34:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, p->data, p->pos); data/mgba-0.8.4+dfsg/src/third-party/lzma/7zBuf2.c:40:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->data + p->pos, buf, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/7zDec.c:264:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(outBuffer, inBuf, curSize); data/mgba-0.8.4+dfsg/src/third-party/lzma/7zFile.c:50:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). p->file = fopen(name, writeMode ? "wb+" : "rb"); data/mgba-0.8.4+dfsg/src/third-party/lzma/7zStream.c:50:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, lookBuf, *size); data/mgba-0.8.4+dfsg/src/third-party/lzma/7zStream.c:131:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, p->buf + p->pos, rem); data/mgba-0.8.4+dfsg/src/third-party/lzma/Alloc.c:27:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char temp[tempSize]; unsigned i = 0; \ data/mgba-0.8.4+dfsg/src/third-party/lzma/Alloc.c:87:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[32]; data/mgba-0.8.4+dfsg/src/third-party/lzma/Alloc.c:94:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[32]; data/mgba-0.8.4+dfsg/src/third-party/lzma/DllSecur.c:60:3: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t buf[MAX_PATH + 100]; data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2Dec.c:165:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->dic + p->dicPos, src, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2Dec.c:456:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dest, p->decoder.dic + dicPos, outCur); data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2Enc.c:176:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(outBuf + destPos, LzmaEnc_GetCurBuf(p->enc) - unpackSize, u); data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma2Enc.c:706:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(me->outBuf, data, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/Lzma86Enc.c:48:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(filteredStream, src, srcLen); data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaDec.c:951:13: [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->tempBuf, src, inSize); data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaDec.c:1051:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dest, p->dic + dicPos, outSizeCur); data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaEnc.c:395:34: [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 COPY_ARR(dest, src, arr) memcpy(dest->arr, src->arr, sizeof(src->arr)); data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaEnc.c:419:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << p->lclp) * sizeof(CLzmaProb)); data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaEnc.c:445:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << dest->lclp) * sizeof(CLzmaProb)); data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaEnc.c:964:11: [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->prices[posState] + kLenNumLowSymbols * 2, p->prices[0] + kLenNumLowSymbols * 2, num); data/mgba-0.8.4+dfsg/src/third-party/lzma/LzmaEnc.c:2784:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->data, data, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/MtDec.c:449:19: [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, parseData, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/MtDec.c:457:17: [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, parseData, parse.srcSize); data/mgba-0.8.4+dfsg/src/third-party/lzma/MtDec.c:485:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data + parse.srcSize, parseData + parse.srcSize, size - parse.srcSize); // we need all data data/mgba-0.8.4+dfsg/src/third-party/lzma/MtDec.c:521:23: [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(cr, parseData + parse.srcSize, crSize); data/mgba-0.8.4+dfsg/src/third-party/lzma/Ppmd7Dec.c:81:28: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. #define MASK(sym) ((signed char *)charMask)[sym] data/mgba-0.8.4+dfsg/src/third-party/lzma/Ppmd7Enc.c:77:28: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. #define MASK(sym) ((signed char *)charMask)[sym] data/mgba-0.8.4+dfsg/src/third-party/lzma/Sha256.c:192:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buffer + pos, data, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/Sha256.c:197:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buffer + pos, data, num); data/mgba-0.8.4+dfsg/src/third-party/lzma/Sha256.c:207:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buffer, data, 64); data/mgba-0.8.4+dfsg/src/third-party/lzma/Sha256.c:212:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buffer, data, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/7z/7zMain.c:261:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char temp[32]; data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/7z/7zMain.c:281:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char temp[16]; data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/7z/7zMain.c:515:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char attr[8], s[32], t[32]; data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/7z/7zMain.c:680:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[32]; data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c:25:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buffer, data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c:34:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buffer, "\nError: "); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c:42:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer + strlen(buffer), "\nError code: %x\n", (unsigned)val); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c:119:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char header[LZMA_PROPS_SIZE + 8]; data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c:254:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char rs[800] = { 0 }; data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:319:7: [2] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. Risk is low because the source is a constant string. wcscpy(path + pathLen, L"7z"); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzDec.c:198:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dest, p->buf + p->bufPos, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzDec.c:214:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buf + p->bufTotal, src, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzDec.c:841:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(filter->props, header + pos, (size_t)size); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzDec.c:1149:11: [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->buf + p->pos, src, cur); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzDec.c:1201:13: [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->buf + p->pos, src, cur); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzDec.c:1291:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buf + p->pos, src, cur); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzDec.c:2156:11: [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(crossBuf, src + srcProcessed, srcSize - srcProcessed); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzEnc.c:60:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(header, XZ_SIG, XZ_SIG_SIZE); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzEnc.c:86:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(header + pos, f->props, f->propsSize); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzEnc.c:143:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(blocks, p->blocks, p->size); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzEnc.c:187:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->blocks + p->size, buf, pos); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzEnc.c:274:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, p->data + (size_t)p->processed, size2); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzEnc.c:303:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->outBuf + (size_t)p->processed, data, size); data/mgba-0.8.4+dfsg/src/third-party/lzma/XzIn.c:307:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, p->streams, p->num * sizeof(CXzStream)); data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:135:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, input, length); data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:142:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, input, remaining); data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:143:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer->data, (const int8_t*) input + remaining, length - remaining); data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:246:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output, data, length); data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:253:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output, data, remaining); data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:254:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((int8_t*) output + remaining, buffer->data, length - remaining); data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:277:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output, data, length); data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:279:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output, data, remaining); data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:280:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((int8_t*) output + remaining, buffer->data, length - remaining); data/mgba-0.8.4+dfsg/src/util/configuration.c:44:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[256]; data/mgba-0.8.4+dfsg/src/util/configuration.c:54:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[256]; data/mgba-0.8.4+dfsg/src/util/configuration.c:108:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char charValue[12]; data/mgba-0.8.4+dfsg/src/util/configuration.c:109:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(charValue, "%i", value); data/mgba-0.8.4+dfsg/src/util/configuration.c:114:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char charValue[12]; data/mgba-0.8.4+dfsg/src/util/configuration.c:115:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(charValue, "%u", value); data/mgba-0.8.4+dfsg/src/util/configuration.c:120:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char charValue[16]; data/mgba-0.8.4+dfsg/src/util/configuration.c:194:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[256]; data/mgba-0.8.4+dfsg/src/util/elf-read.c:91:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ELFProgramHeadersGetPointer(ph, 0), phdr, sizeof(*phdr) * hdr->e_phnum); data/mgba-0.8.4+dfsg/src/util/gui/font.c:59:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[256]; data/mgba-0.8.4+dfsg/src/util/gui/menu.c:205:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char message[256] = {0}; data/mgba-0.8.4+dfsg/src/util/gui/menu.c:305:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[32]; data/mgba-0.8.4+dfsg/src/util/patch-fast.c:106:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(optr, iptr, extent->offset - lastWritten); data/mgba-0.8.4+dfsg/src/util/patch-fast.c:128:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(optr, iptr, outSize - lastWritten); data/mgba-0.8.4+dfsg/src/util/patch-ips.c:17:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[5]; data/mgba-0.8.4+dfsg/src/util/patch-ips.c:50:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, inSize > outSize ? outSize : inSize); data/mgba-0.8.4+dfsg/src/util/patch-ups.c:28:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4]; data/mgba-0.8.4+dfsg/src/util/patch-ups.c:77:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, inSize > outSize ? outSize : inSize); data/mgba-0.8.4+dfsg/src/util/png-io.c:192:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char realName[5]; data/mgba-0.8.4+dfsg/src/util/ring-fifo.c:68:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, value, length); data/mgba-0.8.4+dfsg/src/util/ring-fifo.c:100:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output, data, length); data/mgba-0.8.4+dfsg/src/util/string.c:190:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4]; data/mgba-0.8.4+dfsg/src/util/string.c:201:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(offset, buffer, bytes); data/mgba-0.8.4+dfsg/src/util/string.c:209:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(utf8, buffer, bytes); data/mgba-0.8.4+dfsg/src/util/string.c:220:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(offset, buffer, bytes); data/mgba-0.8.4+dfsg/src/util/string.c:241:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4]; data/mgba-0.8.4+dfsg/src/util/string.c:275:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(utf8, buffer, bytes); data/mgba-0.8.4+dfsg/src/util/string.c:278:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(utf8Offset, buffer, bytes); data/mgba-0.8.4+dfsg/src/util/string.c:289:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(utf8Offset, buffer, bytes); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:12:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[2]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:18:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[2]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:24:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[2]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:30:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:37:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:44:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:51:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:57:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:64:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:71:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:78:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:84:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[4]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:90:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:96:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:102:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:108:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:114:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed[32]; data/mgba-0.8.4+dfsg/src/util/text-codec.c:39:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(node->leaf, output, outputLength); data/mgba-0.8.4+dfsg/src/util/text-codec.c:58:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lineBuffer[128]; data/mgba-0.8.4+dfsg/src/util/text-codec.c:156:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output, node->leaf, outputLength); data/mgba-0.8.4+dfsg/src/util/vfs.c:236:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/mgba-0.8.4+dfsg/src/util/vfs/vfs-fd.c:53:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t wpath[PATH_MAX]; data/mgba-0.8.4+dfsg/src/util/vfs/vfs-fd.c:54:2: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, sizeof(wpath) / sizeof(*wpath)); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-fd.c:57:11: [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). int fd = open(path, flags, 0666); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-file.c:33:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(path, mode); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-file.c:35:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(path, "w+b"); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-file.c:127:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char zeros[128] = ""; data/mgba-0.8.4+dfsg/src/util/vfs/vfs-lzma.c:175:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, vf7z->outBuffer + vf7z->offset + vf7z->bufferOffset, size); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-mem.c:100:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(vfm->mem, mem, size); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-mem.c:127:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(vfm->mem, oldBuf, newSize); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-mem.c:129:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(vfm->mem, oldBuf, vfm->size); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-mem.c:230:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, (void*) ((uintptr_t) vfm->mem + vfm->offset), size); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-mem.c:242:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void*) ((uintptr_t) vfm->mem + vfm->offset), buffer, size); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-mem.c:254:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void*) ((uintptr_t) vfm->mem + vfm->offset), buffer, size); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:48:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[PATH_MAX]; data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:269:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bufferOffset, start, diff); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:491:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tempBuf[1024]; data/mgba-0.8.4+dfsg/include/mgba-util/common.h:240:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #pragma section(".CRT$XCU",read) data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/getopt.h:266:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). current_argv_len = strlen(current_argv); data/mgba-0.8.4+dfsg/include/mgba-util/platform/windows/getopt.h:274:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(long_options[i].name) == current_argv_len) { data/mgba-0.8.4+dfsg/include/mgba-util/socket.h:74:16: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. SOCUBuffer = memalign(SOCU_ALIGN, SOCU_BUFFERSIZE); data/mgba-0.8.4+dfsg/include/mgba-util/socket.h:130:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(socket, buffer, size); data/mgba-0.8.4+dfsg/include/mgba-util/vfs.h:43:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t (*read)(struct VFile* vf, void* buffer, size_t size); data/mgba-0.8.4+dfsg/opt/libgba/mgba.c:39:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(REG_DEBUG_STRING, ptr, len); data/mgba-0.8.4+dfsg/opt/libgba/mgba.c:48:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(REG_DEBUG_STRING, ptr, len); data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:306:58: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ARMDisassemble(&info, cpu->gprs[ARM_PC], disassembly + strlen("00000000: "), sizeof(disassembly) - strlen("00000000: ")); data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:306:102: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ARMDisassemble(&info, cpu->gprs[ARM_PC], disassembly + strlen("00000000: "), sizeof(disassembly) - strlen("00000000: ")); data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:316:63: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ARMDisassemble(&combined, cpu->gprs[ARM_PC], disassembly + strlen("00000000: "), sizeof(disassembly) - strlen("00000000: ")); data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:316:107: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ARMDisassemble(&combined, cpu->gprs[ARM_PC], disassembly + strlen("00000000: "), sizeof(disassembly) - strlen("00000000: ")); data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:319:59: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ARMDisassemble(&info, cpu->gprs[ARM_PC], disassembly + strlen("00000000: "), sizeof(disassembly) - strlen("00000000: ")); data/mgba-0.8.4+dfsg/src/arm/debugger/debugger.c:319:103: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ARMDisassemble(&info, cpu->gprs[ARM_PC], disassembly + strlen("00000000: "), sizeof(disassembly) - strlen("00000000: ")); data/mgba-0.8.4+dfsg/src/arm/decoder.c:48:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "sp", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:51:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "lr", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:54:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "pc", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:57:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "cpsr", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:60:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "spsr", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:72:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "{", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:89:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "-", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:94:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, ",", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:106:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "-", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:112:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "}", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:122:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "_", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:125:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "c", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:129:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "x", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:133:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "s", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:137:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "f", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:152:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "[", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:163:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, ", ", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:169:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "], ", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:182:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "-", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:194:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "]", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:198:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "!", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:209:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, ", ", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:214:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "lsl ", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:218:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "lsr ", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:222:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "asr ", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:226:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "ror ", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:230:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, "rrx", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:381:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "!", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:384:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, ", ", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:389:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "^", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:423:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, ", ", blen); data/mgba-0.8.4+dfsg/src/arm/decoder.c:444:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, ", ", blen - 1); data/mgba-0.8.4+dfsg/src/arm/decoder.c:465:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buffer, ", ", blen - 1); data/mgba-0.8.4+dfsg/src/core/cheats.c:309:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). parseQuotedString(eq, strlen(eq), parsed, sizeof(parsed)); data/mgba-0.8.4+dfsg/src/core/cheats.c:314:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). parseQuotedString(eq, strlen(eq), parsed, sizeof(parsed)); data/mgba-0.8.4+dfsg/src/core/cheats.c:362:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cheatName, name, sizeof(cheatName) - 1); data/mgba-0.8.4+dfsg/src/core/cheats.c:364:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cheatNameLength = strlen(cheatName); data/mgba-0.8.4+dfsg/src/core/cheats.c:458:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vf->write(vf, disabledDirective, strlen(disabledDirective)); data/mgba-0.8.4+dfsg/src/core/cheats.c:471:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vf->write(vf, set->name, strlen(set->name)); data/mgba-0.8.4+dfsg/src/core/cheats.c:477:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vf->write(vf, line, strlen(line)); data/mgba-0.8.4+dfsg/src/core/config.c:132:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). config->port = malloc(strlen("ports.") + strlen(port) + 1); data/mgba-0.8.4+dfsg/src/core/config.c:132:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). config->port = malloc(strlen("ports.") + strlen(port) + 1); data/mgba-0.8.4+dfsg/src/core/config.c:133:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(config->port, strlen("ports.") + strlen(port) + 1, "ports.%s", port); data/mgba-0.8.4+dfsg/src/core/config.c:133:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(config->port, strlen("ports.") + strlen(port) + 1, "ports.%s", port); data/mgba-0.8.4+dfsg/src/core/config.c:150:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, PATH_SEP "config.ini", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/core/config.c:150:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(path, PATH_SEP "config.ini", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/core/config.c:157:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, PATH_SEP "config.ini", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/core/config.c:157:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(path, PATH_SEP "config.ini", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/core/config.c:187:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(out, PATH_SEP "portable.ini", PATH_MAX - strlen(out)); data/mgba-0.8.4+dfsg/src/core/config.c:187:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(out, PATH_SEP "portable.ini", PATH_MAX - strlen(out)); data/mgba-0.8.4+dfsg/src/core/config.c:232:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(out, PATH_SEP "portable.ini", outLength - strlen(out)); data/mgba-0.8.4+dfsg/src/core/config.c:232:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(out, PATH_SEP "portable.ini", outLength - strlen(out)); data/mgba-0.8.4+dfsg/src/core/core.c:157:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read; data/mgba-0.8.4+dfsg/src/core/core.c:160:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((read = vf->read(vf, buffer, sizeof(buffer))) > 0) { data/mgba-0.8.4+dfsg/src/core/core.c:161:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vfm->write(vfm, buffer, read); data/mgba-0.8.4+dfsg/src/core/core.c:162:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). total += read; data/mgba-0.8.4+dfsg/src/core/library.c:393:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(entry->internalCode, (const char*) sqlite3_column_text(library->select, i), sizeof(entry->internalCode) - 1); data/mgba-0.8.4+dfsg/src/core/library.c:395:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(entry->internalTitle, (const char*) sqlite3_column_text(library->select, i), sizeof(entry->internalTitle) - 1); data/mgba-0.8.4+dfsg/src/core/library.c:436:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read; data/mgba-0.8.4+dfsg/src/core/library.c:437:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((read = vf->read(vf, buffer, sizeof(buffer))) > 0) { data/mgba-0.8.4+dfsg/src/core/library.c:438:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vfclone->write(vfclone, buffer, read); data/mgba-0.8.4+dfsg/src/core/serialize.c:116:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &buffer, sizeof(buffer)) != sizeof(buffer)) { data/mgba-0.8.4+dfsg/src/core/serialize.c:141:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, item.data, header.size) != header.size) { data/mgba-0.8.4+dfsg/src/core/serialize.c:418:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, state, stateSize) != stateSize) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:547:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t length = strlen(string[i]); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:826:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(name) != commandLen) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:831:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). commandLen = strlen(aliases[i].original); data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:836:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(name) != commandLen) { data/mgba-0.8.4+dfsg/src/debugger/cli-debugger.c:1106:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (_debuggerCommands[cmd + 1].name && strlen(_debuggerCommands[cmd + 1].name) >= len && name[len - 1] == _debuggerCommands[cmd + 1].name[len - 1]) { data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:251:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "OK", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:277:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "OK", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:316:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "OK", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:387:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "OK", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:437:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "swbreak+;hwbreak+", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:447:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(stub->outgoing, "1", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:449:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "OK", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:451:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "QC1", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:453:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "m1", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:455:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(stub->outgoing, "l", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:466:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "OK", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:480:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(stub->outgoing, "1", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:525:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "OK", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:566:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "OK", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/gdb-stub.c:636:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(stub->outgoing, "OK", GDB_STUB_MAX_LINE - 4); data/mgba-0.8.4+dfsg/src/debugger/test/lexer.c:14: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). size_t adjusted = lexExpression(lv, STR, strlen(STR), ""); \ data/mgba-0.8.4+dfsg/src/debugger/test/lexer.c:15:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_false(adjusted > strlen(STR)) data/mgba-0.8.4+dfsg/src/debugger/test/parser.c:19:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t adjusted = lexExpression(&lp->lv, STR, strlen(STR), ""); \ data/mgba-0.8.4+dfsg/src/debugger/test/parser.c:20:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_false(adjusted > strlen(STR)); \ data/mgba-0.8.4+dfsg/src/feature/commandline.c:55:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(option, pair, eq - pair); data/mgba-0.8.4+dfsg/src/feature/commandline.c:85:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(options, subparser->extraOptions, sizeof(options) - strlen(options) - 1); data/mgba-0.8.4+dfsg/src/feature/commandline.c:85:63: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(options, subparser->extraOptions, sizeof(options) - strlen(options) - 1); data/mgba-0.8.4+dfsg/src/feature/editline/cli-el-backend.c:103:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *len = strlen(ev.str); data/mgba-0.8.4+dfsg/src/feature/ffmpeg/ffmpeg-encoder.c:268:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename) - 1); data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:209:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, PATH_SEP "log", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:209: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). strncat(path, PATH_SEP "log", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:218:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runner->params.currentPath, lastPath, PATH_MAX - 1); data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:282:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, PATH_SEP "log", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:282:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(path, PATH_SEP "log", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:292:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static void _updateLoading(size_t read, size_t size, void* context) { data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:294:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read & 0x3FFFF) { data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:302:184: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). GUIFontPrintf(runner->params.font, runner->params.width / 2, (GUIFontHeight(runner->params.font) + runner->params.height) / 2, GUI_ALIGN_HCENTER, 0xFFFFFFFF, "Loading...%i%%", 100 * read / size); data/mgba-0.8.4+dfsg/src/feature/gui/gui-runner.c:590:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000); data/mgba-0.8.4+dfsg/src/feature/thread-proxy.c:124:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!block || read) { data/mgba-0.8.4+dfsg/src/feature/thread-proxy.c:133:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read; data/mgba-0.8.4+dfsg/src/feature/video-logger.c:391:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t read = src->read(src, writeBuffer, sizeof(writeBuffer)); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:392:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!read) { data/mgba-0.8.4+dfsg/src/feature/video-logger.c:395:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). zstr.avail_in = read; data/mgba-0.8.4+dfsg/src/feature/video-logger.c:444:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). thisRead = src->read(src, fbuffer, thisRead); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:582:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (context->backing->read(context->backing, &buffer, sizeof(buffer)) != sizeof(buffer)) { data/mgba-0.8.4+dfsg/src/feature/video-logger.c:601:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (context->backing->read(context->backing, &header, sizeof(header)) != sizeof(header)) { data/mgba-0.8.4+dfsg/src/feature/video-logger.c:647:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). context->backing->read(context->backing, context->initialState, context->initialStateSize); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:723:58: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). context->backing->write(context->backing, writeBuffer, read); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:857:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). thisRead = vf->read(vf, fbuffer, thisRead); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:904:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read; data/mgba-0.8.4+dfsg/src/feature/video-logger.c:915:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). thisRead = vf->read(vf, buffer, thisRead); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:1033:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read; data/mgba-0.8.4+dfsg/src/feature/video-logger.c:1042:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read = vf->read(vf, &header, sizeof(header)); data/mgba-0.8.4+dfsg/src/feature/video-logger.c:1043:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read != sizeof(header)) { data/mgba-0.8.4+dfsg/src/gb/core.c:498:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, PATH_SEP "gb_bios.bin", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/gb/core.c:498:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(path, PATH_SEP "gb_bios.bin", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/gb/core.c:502:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, PATH_SEP "sgb_bios.bin", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/gb/core.c:502:55: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(path, PATH_SEP "sgb_bios.bin", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/gb/core.c:506:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, PATH_SEP "gbc_bios.bin", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/gb/core.c:506:55: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(path, PATH_SEP "gbc_bios.bin", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/gb/core.c:831:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return vf->read(vf, *sram, vf->size(vf)); data/mgba-0.8.4+dfsg/src/gb/gb.c:179:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, extdataBuffer, vfSize & 0xFF); data/mgba-0.8.4+dfsg/src/gb/gb.c:275:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, gb->memory.sram, gb->sramSize); data/mgba-0.8.4+dfsg/src/gb/gb.c:574:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t size = gb->biosVf->read(gb->biosVf, gb->memory.romBase, GB_SIZE_CART_BANK0); data/mgba-0.8.4+dfsg/src/gb/gb.c:804:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &header, sizeof(header)) < (ssize_t) sizeof(header)) { data/mgba-0.8.4+dfsg/src/gb/mbc.c:1233:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &rtcBuffer, sizeof(rtcBuffer)) < (ssize_t) sizeof(rtcBuffer) - 4) { data/mgba-0.8.4+dfsg/src/gba/core.c:600:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, PATH_SEP "gba_bios.bin", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/gba/core.c:600:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(path, PATH_SEP "gba_bios.bin", PATH_MAX - strlen(path)); data/mgba-0.8.4+dfsg/src/gba/gba.c:233:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). gba->romVf->read(gba->romVf, gba->memory.wram, gba->pristineRomSize); data/mgba-0.8.4+dfsg/src/gba/gba.c:248:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). gba->romVf->read(gba->romVf, &ident, 1); data/mgba-0.8.4+dfsg/src/gba/gba.c:391:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &ident, 1); data/mgba-0.8.4+dfsg/src/gba/gba.c:546:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(oolBuf, gba->debugString, sizeof(oolBuf) - 1); data/mgba-0.8.4+dfsg/src/gba/gba.c:574:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &signature, sizeof(GBA_ROM_MAGIC)) != sizeof(GBA_ROM_MAGIC)) { data/mgba-0.8.4+dfsg/src/gba/gba.c:584:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &signature, sizeof(GBA_ROM_MAGIC2)) != sizeof(GBA_ROM_MAGIC2)) { data/mgba-0.8.4+dfsg/src/gba/gba.c:593:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &buffer, sizeof(buffer)) != sizeof(buffer)) { data/mgba-0.8.4+dfsg/src/gba/gba.c:632:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &signature, sizeof(signature)) != sizeof(signature)) { data/mgba-0.8.4+dfsg/src/gba/gba.c:653:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &signature, sizeof(signature)) != sizeof(signature)) { data/mgba-0.8.4+dfsg/src/gba/gba.c:671:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &signature, sizeof(signature)) != sizeof(signature)) { data/mgba-0.8.4+dfsg/src/gba/gba.c:692:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &interruptTable, sizeof(interruptTable)) != sizeof(interruptTable)) { data/mgba-0.8.4+dfsg/src/gba/gba.c:723:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(out, "(BIOS)", 12); data/mgba-0.8.4+dfsg/src/gba/matrix.c:15:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). gba->romVf->read(gba->romVf, &gba->memory.rom[gba->memory.matrix.vaddr >> 2], gba->memory.matrix.size); data/mgba-0.8.4+dfsg/src/gba/renderers/gl.c:838:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncmp((const char*) version, "OpenGL ES ", strlen("OpenGL ES "))) { data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:396:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, buffer, sizeof(buffer)) != sizeof(buffer)) { data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:413:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &mgm->currentInput, sizeof(uint16_t)); data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:416:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &mgm->previously, sizeof(mgm->previously)); data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:419:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &mgm->nextTime, sizeof(mgm->nextTime)); data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:422:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &mgm->maxStreamId, sizeof(mgm->maxStreamId)); data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:425:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &mgm->d.frames, sizeof(mgm->d.frames)); data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:428:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &mgm->d.lagFrames, sizeof(mgm->d.lagFrames)); data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:431:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &mgm->d.rrCount, sizeof(mgm->d.rrCount)); data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:464:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &tagBuffer, 1) != 1) { data/mgba-0.8.4+dfsg/src/gba/rr/mgm.c:536:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (mgm->movieStream->read(mgm->movieStream, &tagBuffer, 1) != 1) { data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:118:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vbm->vbmFile->read(vbm->vbmFile, &input, sizeof(input)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:130:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vbm->vbmFile->read(vbm->vbmFile, &input, sizeof(input)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:155:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vbm->vbmFile->read(vbm->vbmFile, &saveType, sizeof(saveType)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:156:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vbm->vbmFile->read(vbm->vbmFile, &flashSize, sizeof(flashSize)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:158:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vbm->vbmFile->read(vbm->vbmFile, &sramOffset, sizeof(sramOffset)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:186:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vbm->vbmFile->read(vbm->vbmFile, zbuffer, zlen); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:230:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, magic, sizeof(magic)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:236:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &id, sizeof(id)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:242:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &vbm->d.frames, sizeof(vbm->d.frames)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:243:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &vbm->d.rrCount, sizeof(vbm->d.rrCount)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:246:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &flags, sizeof(flags)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:261:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &flags, sizeof(flags)); data/mgba-0.8.4+dfsg/src/gba/rr/vbm.c:270:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, &vbm->inputOffset, sizeof(vbm->inputOffset)); data/mgba-0.8.4+dfsg/src/gba/savedata.c:144:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read = savedata->vf->read(savedata->vf, buffer, sizeof(buffer)); data/mgba-0.8.4+dfsg/src/gba/savedata.c:145:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). out->write(out, buffer, read); data/mgba-0.8.4+dfsg/src/gba/savedata.c:147:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read >= 0; data/mgba-0.8.4+dfsg/src/gba/savedata.c:182:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return in->read(in, savedata->data, size) == size; data/mgba-0.8.4+dfsg/src/gba/savedata.c:190:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read = in->read(in, buffer, sizeof(buffer)); data/mgba-0.8.4+dfsg/src/gba/savedata.c:191:54: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read = savedata->vf->write(savedata->vf, buffer, read); data/mgba-0.8.4+dfsg/src/gba/savedata.c:204:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read >= 0; data/mgba-0.8.4+dfsg/src/gba/sharkport.c:19:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &buffer.i, 4) < 4) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:24:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (size != (int32_t) strlen(SHARKPORT_HEADER)) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:27:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, buffer.c, size) < size) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:33:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &buffer.i, 4) < 4) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:43:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &buffer.i, 4) < 4) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:51:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &buffer.i, 4) < 4) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:59:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &buffer.i, 4) < 4) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:68:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &buffer.i, 4) < 4) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:76:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, payload, size) < size) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:99:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &buffer.i, 4) < 4) { data/mgba-0.8.4+dfsg/src/gba/sharkport.c:162:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). uint32_t size = strlen(SHARKPORT_HEADER); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:243:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:243:57: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:244:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (dir[strlen(dir) - 1] == '/') { data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:261:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:261:57: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:262:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (dir[strlen(dir) - 1] == '/') { data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:282:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:282:57: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/platform/3ds/3ds-vfs.c:283:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (dir[strlen(dir) - 1] == '/') { data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.c:681:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vfm->read(vfm, data, size); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.c:712:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(code) + 1; // Include null terminator data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.c:733:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(code) + 1; // Include null terminator data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.h:1391:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). retro_vfs_read_t read; data/mgba-0.8.4+dfsg/src/platform/libretro/libretro.h:1471:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). retro_midi_read_t read; data/mgba-0.8.4+dfsg/src/platform/libretro/libretro_core_options.h:298:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buf_len += strlen(values[num_values].value); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro_core_options.h:311:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buf_len += strlen(desc); data/mgba-0.8.4+dfsg/src/platform/libretro/libretro_core_options.h:328:22: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(values_buf[i], "|"); data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.c:468:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncmp((const char*) version, "OpenGL ES ", strlen("OpenGL ES ")) == 0) { data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.c:905:61: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). uniform->name = strdup(strstr(uniform->name, "uniform.") + strlen("uniform.")); data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.c:949:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fsf->read(fsf, fssrc, fsf->size(fsf)); data/mgba-0.8.4+dfsg/src/platform/opengl/gles2.c:961:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vsf->read(vsf, vssrc, vsf->size(vsf)); data/mgba-0.8.4+dfsg/src/platform/psp2/psp2-context.c:209:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sceCameraRead(imageSource->cam - 1, &read); data/mgba-0.8.4+dfsg/src/platform/psp2/psp2-context.c:242:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sceCameraRead(imageSource->cam - 1, &read); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:216:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + strlen(PATH_SEP) + 1)); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:216:57: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + strlen(PATH_SEP) + 1)); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:216:71: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + strlen(PATH_SEP) + 1)); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:230:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + strlen(PATH_SEP) + 1)); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:230:57: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + strlen(PATH_SEP) + 1)); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:230:71: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + strlen(PATH_SEP) + 1)); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:247:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + strlen(PATH_SEP) + 1)); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:247:57: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + strlen(PATH_SEP) + 1)); data/mgba-0.8.4+dfsg/src/platform/psp2/sce-vfs.c:247:71: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + strlen(PATH_SEP) + 1)); data/mgba-0.8.4+dfsg/src/platform/qt/AbstractUpdater.cpp:82:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). QByteArray bytes = reply->read(4096); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:160:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncmp(loadstateMessage, format, strlen(loadstateMessage)) == 0) { data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:168:55: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). } else if (strncmp(savestateFailedMessage, format, strlen(savestateFailedMessage)) == 0 || strncmp(savestateMessage, format, strlen(savestateMessage)) == 0) { data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:168:129: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). } else if (strncmp(savestateFailedMessage, format, strlen(savestateFailedMessage)) == 0 || strncmp(savestateMessage, format, strlen(savestateMessage)) == 0) { data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:541:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, controller->m_backupSaveState.data(), controller->m_backupSaveState.size()); data/mgba-0.8.4+dfsg/src/platform/qt/CoreController.cpp:555:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, controller->m_backupSaveState.data(), controller->m_backupSaveState.size()); data/mgba-0.8.4+dfsg/src/platform/qt/CoreManager.cpp:44:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read; data/mgba-0.8.4+dfsg/src/platform/qt/CoreManager.cpp:45:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((read = vf->read(vf, buffer, sizeof(buffer))) > 0) { data/mgba-0.8.4+dfsg/src/platform/qt/CoreManager.cpp:46:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vfclone->write(vfclone, buffer, read); data/mgba-0.8.4+dfsg/src/platform/qt/CoreManager.cpp:162:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(core->dirs.baseName, bytes.constData(), sizeof(core->dirs.baseName)); data/mgba-0.8.4+dfsg/src/platform/qt/DisplayGL.cpp:437:13: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. QThread::usleep(500); data/mgba-0.8.4+dfsg/src/platform/qt/FrameView.cpp:392:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). m_currentFrame->read(m_currentFrame, buffer, m_currentFrame->size(m_currentFrame)); data/mgba-0.8.4+dfsg/src/platform/qt/VFileDevice.cpp:49:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return m_vf->read(m_vf, data, maxSize); data/mgba-0.8.4+dfsg/src/platform/qt/VideoProxy.cpp:74:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!block || read) { data/mgba-0.8.4+dfsg/src/platform/qt/VideoProxy.cpp:82:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read; data/mgba-0.8.4+dfsg/src/platform/qt/main.cpp:127:66: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). argv8.push_back(utf16to8(reinterpret_cast<uint16_t*>(argv[i]), wcslen(argv[i]) * 2)); data/mgba-0.8.4+dfsg/src/platform/sdl/gles2-sdl.c:41:27: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. renderer->outputBuffer = memalign(16, size); data/mgba-0.8.4+dfsg/src/platform/sdl/main.c:188:44: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). argv8[i] = utf16to8((uint16_t*) argv[i], wcslen(argv[i]) * 2); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:944:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). malloc(size + strlen(arg0) + 1) data/mgba-0.8.4+dfsg/src/platform/switch/main.c:946:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, buffer[0], vf->size(vf)); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:948:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(buffer[1], size + strlen(arg0), buffer[0], arg0); data/mgba-0.8.4+dfsg/src/platform/switch/main.c:952:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vf->write(vf, buffer[1], strlen(buffer[1])); data/mgba-0.8.4+dfsg/src/platform/test/fuzz-main.c:138:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). savestate->read(savestate, state, size); data/mgba-0.8.4+dfsg/src/platform/test/fuzz-main.c:139:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). savestateOverlay->read(savestateOverlay, state + overlayOffset, size - overlayOffset); data/mgba-0.8.4+dfsg/src/platform/test/perf-main.c:254:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SocketSend(_socket, buffer, strlen(buffer)); data/mgba-0.8.4+dfsg/src/platform/test/perf-main.c:322:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SocketSend(_socket, header, strlen(header)); data/mgba-0.8.4+dfsg/src/platform/test/tbl-fuzz-main.c:20:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (vf->read(vf, &c, 1) > 0) { data/mgba-0.8.4+dfsg/src/platform/wii/gui-font.c:30:18: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. void* fontTpl = memalign(32, font_size); data/mgba-0.8.4+dfsg/src/platform/wii/gui-font.c:38:19: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. void* iconsTpl = memalign(32, icons_size); data/mgba-0.8.4+dfsg/src/platform/wii/main.c:273:15: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. void* fifo = memalign(32, 0x40000); data/mgba-0.8.4+dfsg/src/platform/wii/main.c:315:11: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. texmem = memalign(32, TEX_W * TEX_H * BYTES_PER_PIXEL); data/mgba-0.8.4+dfsg/src/platform/wii/main.c:317:21: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. interframeTexmem = memalign(32, TEX_W * TEX_H * BYTES_PER_PIXEL); data/mgba-0.8.4+dfsg/src/platform/wii/main.c:319:18: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. rescaleTexmem = memalign(32, TEX_W * TEX_H * 4 * BYTES_PER_PIXEL); data/mgba-0.8.4+dfsg/src/platform/wii/main.c:813:17: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. outputBuffer = memalign(32, TEX_W * TEX_H * BYTES_PER_PIXEL); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:115:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t size = sizeof(char) * (strlen(path) + strlen(dir) + 2); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:115:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t size = sizeof(char) * (strlen(path) + strlen(dir) + 2); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:130:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t size = sizeof(char) * (strlen(path) + strlen(dir) + 2); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:130:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t size = sizeof(char) * (strlen(path) + strlen(dir) + 2); data/mgba-0.8.4+dfsg/src/platform/windows/vfs-w32.c:162:19: [1] (buffer) wcslen: Does not handle 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 = 4 * wcslen(vdwe->ffData.cFileName); data/mgba-0.8.4+dfsg/src/sm83/decoder.c:507:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, " ", blen - 1); data/mgba-0.8.4+dfsg/src/sm83/decoder.c:511:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "[", blen - 1); data/mgba-0.8.4+dfsg/src/sm83/decoder.c:526:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "+", blen - 1); data/mgba-0.8.4+dfsg/src/sm83/decoder.c:531:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "+", blen - 1); data/mgba-0.8.4+dfsg/src/sm83/decoder.c:535:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "-", blen - 1); data/mgba-0.8.4+dfsg/src/sm83/decoder.c:539:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, "]", blen - 1); data/mgba-0.8.4+dfsg/src/sm83/decoder.c:559:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, ",", blen - 1); data/mgba-0.8.4+dfsg/src/sm83/decoder.c:571:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buffer, ",", blen - 1); data/mgba-0.8.4+dfsg/src/third-party/lzma/Alloc.c:69:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(s); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c:36:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(buffer, "\n"); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c:42:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sprintf(buffer + strlen(buffer), "\nError code: %x\n", (unsigned)val); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/Lzma/LzmaUtil.c:194:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (numArgs < 3 || numArgs > 4 || strlen(args[1]) != 1) data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:53:28: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). unsigned len = (unsigned)wcslen(s); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:75:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). unsigned itemLen = (unsigned)strlen(item); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:182:16: [1] (buffer) wcslen: Does not handle 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 = wcslen(path); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:183:3: [1] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. Risk is low because the source is a constant character. wcscpy(path + len, L"*"); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:309:15: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). pathLen = wcslen(path); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:322:29: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). wchar_t *s = path + wcslen(path); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:339:19: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). pathLen = wcslen(path); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:457:36: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). unsigned len = (unsigned)wcslen(name); data/mgba-0.8.4+dfsg/src/third-party/lzma/Util/SfxSetup/SfxSetup.c:575:11: [1] (buffer) wcslen: Does not handle 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 (wcslen(cmdLineParams) != 0) data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:187:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read; data/mgba-0.8.4+dfsg/src/util/circle-buffer.c:217:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read; data/mgba-0.8.4+dfsg/src/util/crc32.c:129:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). blocksize = vf->read(vf, buffer, toRead); data/mgba-0.8.4+dfsg/src/util/gui.c:13:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(params->currentPath, params->basePath, PATH_MAX); data/mgba-0.8.4+dfsg/src/util/gui/file-select.c:87:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(name) + 2; data/mgba-0.8.4+dfsg/src/util/gui/file-select.c:184:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(params->currentPath); data/mgba-0.8.4+dfsg/src/util/gui/file-select.c:203:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(params->currentPath, outPath, PATH_MAX); data/mgba-0.8.4+dfsg/src/util/gui/font.c:12:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(text); data/mgba-0.8.4+dfsg/src/util/gui/font.c:40:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(text); data/mgba-0.8.4+dfsg/src/util/patch-ips.c:18:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, buffer, 5) != 5) { data/mgba-0.8.4+dfsg/src/util/patch-ips.c:27:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, buffer, 3) != 3) { data/mgba-0.8.4+dfsg/src/util/patch-ips.c:57:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, &offset, 3) != 3) { data/mgba-0.8.4+dfsg/src/util/patch-ips.c:66:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, &size, 2) != 2) { data/mgba-0.8.4+dfsg/src/util/patch-ips.c:71:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, &size, 2) != 2) { data/mgba-0.8.4+dfsg/src/util/patch-ips.c:76:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, &byte, 1) != 1) { data/mgba-0.8.4+dfsg/src/util/patch-ips.c:88:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, &buf[offset], size) != size) { data/mgba-0.8.4+dfsg/src/util/patch-ups.c:29:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, buffer, 4) != 4) { data/mgba-0.8.4+dfsg/src/util/patch-ups.c:45:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, &goodCrc32, 4) != 4) { data/mgba-0.8.4+dfsg/src/util/patch-ups.c:87:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, &byte, 1) != 1) { data/mgba-0.8.4+dfsg/src/util/patch-ups.c:104:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, &goodCrc32, 4) != 4) { data/mgba-0.8.4+dfsg/src/util/patch-ups.c:119:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). patch->vf->read(patch->vf, &expectedInChecksum, sizeof(expectedInChecksum)); data/mgba-0.8.4+dfsg/src/util/patch-ups.c:120:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). patch->vf->read(patch->vf, &expectedOutChecksum, sizeof(expectedOutChecksum)); data/mgba-0.8.4+dfsg/src/util/patch-ups.c:162:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (patch->vf->read(patch->vf, &writeBuffer[writeLocation], length) != (ssize_t) length) { data/mgba-0.8.4+dfsg/src/util/patch-ups.c:216:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (vf->read(vf, &byte, 1) != 1) { data/mgba-0.8.4+dfsg/src/util/png-io.c:22:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t read = vf->read(vf, buffer, size); data/mgba-0.8.4+dfsg/src/util/png-io.c:23:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read != size) { data/mgba-0.8.4+dfsg/src/util/png-io.c:193:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(realName, name, 4); data/mgba-0.8.4+dfsg/src/util/png-io.c:213:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (source->read(source, header, PNG_HEADER_BYTES) < PNG_HEADER_BYTES) { data/mgba-0.8.4+dfsg/src/util/png-io.c:238:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(chunkName); data/mgba-0.8.4+dfsg/src/util/ring-fifo.c:26:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). const void* read; data/mgba-0.8.4+dfsg/src/util/ring-fifo.c:28:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ATOMIC_LOAD_PTR(read, buffer->readPtr); data/mgba-0.8.4+dfsg/src/util/ring-fifo.c:30:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read <= write) { data/mgba-0.8.4+dfsg/src/util/ring-fifo.c:31:42: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return (uintptr_t) write - (uintptr_t) read; data/mgba-0.8.4+dfsg/src/util/string.c:18:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(out, start, len); data/mgba-0.8.4+dfsg/src/util/string.c:26:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(str); data/mgba-0.8.4+dfsg/src/util/string.c:28:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(out, str, len); data/mgba-0.8.4+dfsg/src/util/string.c:37:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t needleLen = strlen(needle); data/mgba-0.8.4+dfsg/src/util/string.c:47:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(s1); data/mgba-0.8.4+dfsg/src/util/string.c:48:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t endLen = strlen(end); data/mgba-0.8.4+dfsg/src/util/string.c:56:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(s1); data/mgba-0.8.4+dfsg/src/util/string.c:57:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t startLen = strlen(start); data/mgba-0.8.4+dfsg/src/util/string.c:438:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* end = string + strlen(string) - 1; data/mgba-0.8.4+dfsg/src/util/table.c:177:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). uint32_t hash = hash32(key, strlen(key), 0); data/mgba-0.8.4+dfsg/src/util/table.c:186:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). uint32_t hash = hash32(key, strlen(key), 0); data/mgba-0.8.4+dfsg/src/util/table.c:200:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). list->list[list->nEntries].keylen = strlen(key); data/mgba-0.8.4+dfsg/src/util/table.c:207:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). uint32_t hash = hash32(key, strlen(key), 0); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:19:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), 0); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:25:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), 0); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:31:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("plain")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:31:94: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("plain")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:38:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed), parsed, sizeof(parsed)), strlen("plain")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:38:90: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed), parsed, sizeof(parsed)), strlen("plain")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:45:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("trailing")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:45:94: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("trailing")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:52:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), -1); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:58:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("back\\slash")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:58:94: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("back\\slash")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:65:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("back\\\\slash")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:65:94: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("back\\\\slash")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:72:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("\"'\n\r\\")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:72:94: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), strlen("\"'\n\r\\")); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:79:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), -1); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:85:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), -1); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:91:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), -1); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:103:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed), parsed, sizeof(parsed)), -1); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:109:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), -1); data/mgba-0.8.4+dfsg/src/util/test/string-parser.c:115:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(parseQuotedString(unparsed, strlen(unparsed) + 1, parsed, sizeof(parsed)), 1); data/mgba-0.8.4+dfsg/src/util/vfs.c:118:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t newRead = vf->read(vf, &buffer[bytesRead], 1); data/mgba-0.8.4+dfsg/src/util/vfs.c:145:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t r = vf->read(vf, &leword, 4); data/mgba-0.8.4+dfsg/src/util/vfs.c:154:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t r = vf->read(vf, &lehword, 2); data/mgba-0.8.4+dfsg/src/util/vfs.c:166:50: [1] (buffer) strlen: Does not handle 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* separatorPoint = strnrstr(path, PATH_SEP, strlen(path)); data/mgba-0.8.4+dfsg/src/util/vfs.c:175:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dirname, path, len); data/mgba-0.8.4+dfsg/src/util/vfs.c:180:3: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(dirname, "."); data/mgba-0.8.4+dfsg/src/util/vfs.c:187:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(path); data/mgba-0.8.4+dfsg/src/util/vfs.c:192:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(basename, path, len); data/mgba-0.8.4+dfsg/src/util/vfs.c:198:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(dotPoint); data/mgba-0.8.4+dfsg/src/util/vfs.c:202:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(extension, dotPoint, PATH_MAX - 1); data/mgba-0.8.4+dfsg/src/util/vfs.c:234:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t prefixLen = strlen(basename); data/mgba-0.8.4+dfsg/src/util/vfs.c:235:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t infixLen = strlen(infix); data/mgba-0.8.4+dfsg/src/util/vfs.c:241:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(filename); data/mgba-0.8.4+dfsg/src/util/vfs.c:261:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(separator); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-devlist.c:76:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vdl->vde.name = malloc(strlen(devops->name) + 3); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:102:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:102:57: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:116:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:116:57: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:133:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:133:57: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(path) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:159:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* combined = malloc(sizeof(char) * (strlen(vdede->ent->d_name) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-dirent.c:159:71: [1] (buffer) strlen: Does not handle 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* combined = malloc(sizeof(char) * (strlen(vdede->ent->d_name) + strlen(dir) + 2)); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-fd.c:120:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(vfd->fd, buffer, size); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-lzma.c:262:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t pathLength = strlen(path); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:113:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t r = vf->read(vf, buf, size); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:241:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read = vf->read(vf, 0, position - vfz->offset); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:242:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read < 0) { data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:322:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, 0, size - vfz->readSize); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:496:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read = vf->read(vf, tempBuf, toRead); data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:497:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read < toRead) { data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:500:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). currentPos += read; data/mgba-0.8.4+dfsg/src/util/vfs/vfs-zip.c:537:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vf->read(vf, vfz->buffer, size); ANALYSIS SUMMARY: Hits = 1087 Lines analyzed = 141511 in approximately 3.61 seconds (39218 lines/second) Physical Source Lines of Code (SLOC) = 115059 Hits@level = [0] 248 [1] 393 [2] 475 [3] 16 [4] 202 [5] 1 Hits@level+ = [0+] 1335 [1+] 1087 [2+] 694 [3+] 219 [4+] 203 [5+] 1 Hits/KSLOC@level+ = [0+] 11.6027 [1+] 9.44733 [2+] 6.03169 [3+] 1.90337 [4+] 1.76431 [5+] 0.00869119 Dot directories skipped = 2 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.