From 240e6227e9eb88a4c491388ef0b50c7436868044 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 23 Jul 2020 04:16:00 -0700 Subject: [PATCH] kern: Fix bug when reducing heap size --- libraries/libmesosphere/source/kern_k_page_table_base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libmesosphere/source/kern_k_page_table_base.cpp b/libraries/libmesosphere/source/kern_k_page_table_base.cpp index cf59c3b0e..11544058a 100644 --- a/libraries/libmesosphere/source/kern_k_page_table_base.cpp +++ b/libraries/libmesosphere/source/kern_k_page_table_base.cpp @@ -1181,7 +1181,7 @@ namespace ams::kern { KScopedPageTableUpdater updater(this); /* Validate memory state. */ - R_TRY(this->CheckMemoryState(this->heap_region_start + size, (this->heap_region_end - this->heap_region_start) - size, + R_TRY(this->CheckMemoryState(this->heap_region_start + size, (this->current_heap_end - this->heap_region_start) - size, KMemoryState_All, KMemoryState_Normal, KMemoryPermission_All, KMemoryPermission_UserReadWrite, KMemoryAttribute_All, KMemoryAttribute_None));