mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00: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
@ -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…
Reference in New Issue
Block a user