GBA: Check for improperly sized savestates when loading
Jeffrey Pfau jeffrey@endrift.com
Mon, 01 Jun 2015 20:53:41 -0700
2 files changed,
4 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -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.c
→
src/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;