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.
This commit is contained in:
Stephen Miller 2025-07-25 13:40:14 -05:00 committed by GitHub
parent 8b1b0fa0dc
commit 90705cbe51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -740,8 +740,8 @@ s32 MemoryManager::DirectMemoryQuery(PAddr addr, bool find_next,
dmem_area++; dmem_area++;
} }
if (dmem_area->second.is_free) { if (dmem_area->second.is_free || addr >= total_direct_size) {
LOG_ERROR(Core, "Unable to find allocated direct memory region to query!"); LOG_WARNING(Kernel_Vmm, "Unable to find allocated direct memory region to query!");
return ORBIS_KERNEL_ERROR_EACCES; return ORBIS_KERNEL_ERROR_EACCES;
} }