From 1f5ce4f619c6133091b4687e98c557a8dbfce636 Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 13 May 2022 09:27:00 +0300 Subject: [PATCH] Loader: Fix out-of-bounds access of string There was no need to manually align size, it only creates a bug with memcpy usage. --- rpcs3/Emu/Cell/PPUModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index fbb5f71a3a..1bd58fe129 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -1749,7 +1749,7 @@ bool ppu_load_exec(const ppu_exec_object& elf) for (const auto& arg : Emu.argv) { - const u32 arg_size = utils::align(::size32(arg) + 1, 0x10); + const u32 arg_size = ::size32(arg) + 1; const u32 arg_addr = vm::alloc(arg_size, vm::main); std::memcpy(vm::base(arg_addr), arg.data(), arg_size); @@ -1762,7 +1762,7 @@ bool ppu_load_exec(const ppu_exec_object& elf) for (const auto& arg : Emu.envp) { - const u32 arg_size = utils::align(::size32(arg) + 1, 0x10); + const u32 arg_size = ::size32(arg) + 1; const u32 arg_addr = vm::alloc(arg_size, vm::main); std::memcpy(vm::base(arg_addr), arg.data(), arg_size);