mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
Loader: Fix out-of-bounds access of string
There was no need to manually align size, it only creates a bug with memcpy usage.
This commit is contained in:
parent
524da5dc54
commit
1f5ce4f619
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue