mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +00:00
Return ENOMEM if len exceeds the available space in sceKernelMapNamedDirectMemory
This commit is contained in:
parent
5bc4cc761a
commit
ccfb2b03f7
@ -194,6 +194,10 @@ int PS4_SYSV_ABI sceKernelMapNamedDirectMemory(void** addr, u64 len, int prot, i
|
|||||||
const auto map_flags = static_cast<Core::MemoryMapFlags>(flags);
|
const auto map_flags = static_cast<Core::MemoryMapFlags>(flags);
|
||||||
|
|
||||||
auto* memory = Core::Memory::Instance();
|
auto* memory = Core::Memory::Instance();
|
||||||
|
if (memory->GetTotalDirectSize() < len) {
|
||||||
|
LOG_ERROR(Kernel_Vmm, "Length is too big!");
|
||||||
|
return ORBIS_KERNEL_ERROR_ENOMEM;
|
||||||
|
}
|
||||||
const auto ret =
|
const auto ret =
|
||||||
memory->MapMemory(addr, in_addr, len, mem_prot, map_flags, Core::VMAType::Direct, name,
|
memory->MapMemory(addr, in_addr, len, mem_prot, map_flags, Core::VMAType::Direct, name,
|
||||||
false, directMemoryStart, alignment);
|
false, directMemoryStart, alignment);
|
||||||
|
Loading…
Reference in New Issue
Block a user