all repos — mgba @ ad1208470e21397fee535baa1ddd2148686e6c4a

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

ad1208470e21397fee535baa1ddd2148686e6c4a

parent

6f82448aa952ab5e68aac930c339a9501c46b680

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

jump to
M CHANGESCHANGES

@@ -7,6 +7,7 @@ - Qt: Fix open ROM dialog filtering for archive formats

- ARM7: Fix Thumb MUL timing - GBA: Cap audio FIFO read size during deserialization - GBA: Check for corrupted savestates when loading + - GBA: Check for improperly sized savestates when loading Misc: - All: Fix sanitize-deb script to set file permissions properly if run as (fake)root - All: Enable static linking for Windows
M src/gba/serialize.csrc/gba/serialize.c

@@ -250,6 +250,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;