From 90705cbe51ec2818149cd4f50d46512ca6f0157c Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Fri, 25 Jul 2025 13:40:14 -0500 Subject: [PATCH] Return error if dmem query address is too high (#3325) Also adjusts the log message to align with how we log error returns in sceKernelVirtualQuery. --- src/core/memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 12099ea73..72ba70eba 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -740,8 +740,8 @@ s32 MemoryManager::DirectMemoryQuery(PAddr addr, bool find_next, dmem_area++; } - if (dmem_area->second.is_free) { - LOG_ERROR(Core, "Unable to find allocated direct memory region to query!"); + if (dmem_area->second.is_free || addr >= total_direct_size) { + LOG_WARNING(Kernel_Vmm, "Unable to find allocated direct memory region to query!"); return ORBIS_KERNEL_ERROR_EACCES; }