diff options
| -rw-r--r-- | Private/NewKit/Json.hpp | 2 | ||||
| -rw-r--r-- | Private/Source/PageManager.cxx | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Private/NewKit/Json.hpp b/Private/NewKit/Json.hpp index d52f1d4a..1c404397 100644 --- a/Private/NewKit/Json.hpp +++ b/Private/NewKit/Json.hpp @@ -56,7 +56,7 @@ struct JsonStreamTraits final { for (SizeT i = 1; i < len; i++) { if (full_array[i] == ' ') continue; - JsonType type(255, 255); + JsonType type(kPathLen, kPathLen); if (probe_key) { type.AsKey().Data()[key_len] = full_array[i]; diff --git a/Private/Source/PageManager.cxx b/Private/Source/PageManager.cxx index d6455a18..7dec0343 100644 --- a/Private/Source/PageManager.cxx +++ b/Private/Source/PageManager.cxx @@ -10,6 +10,9 @@ #include <KernelKit/DebugOutput.hpp> #include <NewKit/PageManager.hpp> +//! null deref will throw (Page Zero detected, aborting program!) +#define kProtectedRegionEnd 512 + namespace HCore { PTEWrapper::PTEWrapper(Boolean Rw, Boolean User, Boolean ExecDisable, UIntPtr VirtAddr) @@ -23,11 +26,12 @@ PTEWrapper::PTEWrapper(Boolean Rw, Boolean User, Boolean ExecDisable, m_Present(true), m_Accessed(false) { // special case for the null region. - if (VirtAddr == 0) { + if (VirtAddr <= kProtectedRegionEnd) { m_Wt = false; m_Rw = false; m_Cache = false; m_Shareable = false; + m_ExecDisable = true; } } |
