all repos — mgba @ af77e5ab62a920000b8e33544ba2f2efa0cb42e9

mGBA Game Boy Advance Emulator

Util: Fix overflow when loading invalid UPS patches
Vicki Pfau vi@endrift.com
Wed, 01 Feb 2017 13:21:26 -0800
commit

af77e5ab62a920000b8e33544ba2f2efa0cb42e9

parent

181c05c7ac8a739cd6d9dea393ac9a30e1898d96

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

jump to
M CHANGESCHANGES

@@ -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.csrc/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) {