diff --git a/kernel/src/memory/MemoryManager.cpp b/kernel/src/memory/MemoryManager.cpp index 2c86a8b8..d597f397 100644 --- a/kernel/src/memory/MemoryManager.cpp +++ b/kernel/src/memory/MemoryManager.cpp @@ -562,7 +562,7 @@ namespace MemoryManager while (size--) { // Crossed a page boundary, gotta check the page tables again before touching any memory!! - if (user_ptr % ARCH_PAGE_SIZE) + if ((user_ptr % ARCH_PAGE_SIZE) == 0) { if (!validate_page_access(user_ptr, MMU::ReadWrite | MMU::User)) return false; } @@ -590,7 +590,7 @@ namespace MemoryManager while (size--) { // Crossed a page boundary, gotta check the page tables again before touching any memory!! - if (user_ptr % ARCH_PAGE_SIZE) + if ((user_ptr % ARCH_PAGE_SIZE) == 0) { if (!validate_page_access(user_ptr, MMU::User)) return false; }