all repos — mgba @ 502ca7abd7b689e15a4cfaf9ad0d346777215179

mGBA Game Boy Advance Emulator

GBA: Check for improperly sized savestates when loading
Jeffrey Pfau jeffrey@endrift.com
Mon, 01 Jun 2015 20:53:41 -0700
commit

502ca7abd7b689e15a4cfaf9ad0d346777215179

parent

ee6e53cfc88a09a4f499a038b06856a6acdc6e7b

2 files changed, 4 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -35,6 +35,7 @@ - Qt: Cap the maximum number of multiplayer windows

- Qt: Fix maximum year in sensor override - GBA: Cap audio FIFO read size during deserialization - GBA: Check for corrupted savestates when loading + - GBA: Check for improperly sized savestates when loading Misc: - Qt: Handle saving input settings better - Debugger: Free watchpoints in addition to breakpoints
M src/gba/serialize.csrc/gba/serialize.c

@@ -264,6 +264,9 @@ if (isPNG(vf)) {

return _loadPNGState(gba, vf); } #endif + if (vf->size(vf) < (ssize_t) sizeof(struct GBASerializedState)) { + return false; + } struct GBASerializedState* state = vf->map(vf, sizeof(struct GBASerializedState), MAP_READ); if (!state) { return false;