From fdcc5adc8d10383973852aadff746de3c9006696 Mon Sep 17 00:00:00 2001 From: "Chris Weermann (TGE)" Date: Wed, 20 Jun 2018 21:52:14 +0200 Subject: [PATCH] Fix overflow in PPUThread stack frame dump --- rpcs3/Emu/Cell/PPUThread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 45b1e38015..b7cbf0f64f 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -492,7 +492,7 @@ std::string ppu_thread::dump() const stack_max += 4096; } - for (u64 sp = vm::read64(stack_ptr); sp >= stack_min && sp + 0x200 < stack_max; sp = vm::read64(static_cast(sp))) + for (u64 sp = vm::read64(stack_ptr); sp >= stack_min && std::max(sp, sp + 0x200) < stack_max; sp = vm::read64(static_cast(sp))) { // TODO: print also function addresses fmt::append(ret, "> from 0x%08llx (0x0)\n", vm::read64(static_cast(sp + 16)));