From de7aa3106adcdc14ed5e09c653133115a83e512a Mon Sep 17 00:00:00 2001 From: Rozlette Date: Sat, 20 Jan 2018 14:56:15 -0600 Subject: memory: Return false for large VAddr in IsValidVirtualAddress --- src/core/memory.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 74a598852..a3d2d4951 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -219,6 +219,9 @@ void Write(const VAddr vaddr, const T data) { bool IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) { auto& page_table = process.vm_manager.page_table; + if ((vaddr >> PAGE_BITS) >= PAGE_TABLE_NUM_ENTRIES) + return false; + const u8* page_pointer = page_table.pointers[vaddr >> PAGE_BITS]; if (page_pointer) return true; -- cgit v1.2.3