Util: Fix overflow when loading invalid UPS patches
Vicki Pfau vi@endrift.com
Wed, 01 Feb 2017 13:21:26 -0800
2 files changed,
4 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -21,6 +21,7 @@ - LR35902: Fix pc overflowing current region off-by-one
- GB MBC: Fix ROM bank overflows getting set to bank 0 - Qt: Fix timing issues on high refresh rate monitors - GBA Savedata: Fix savedata unmasking (fixes mgba.io/i/441) + - Util: Fix overflow when loading invalid UPS patches Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers
M
src/util/patch-ups.c
→
src/util/patch-ups.c
@@ -87,6 +87,9 @@ while (true) {
if (patch->vf->read(patch->vf, &byte, 1) != 1) { return false; } + if (offset >= outSize) { + return false; + } buf[offset] ^= byte; ++offset; if (!byte) {