mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-28 15:34:31 +00:00
Refactor BaseBufferStackError function
This commit is contained in:
parent
740f100843
commit
2d5bb5193d
@ -301,7 +301,7 @@ ExceptionExit:
|
||||
ExceptionLock.store(false, std::memory_order_release);
|
||||
}
|
||||
|
||||
nsa void BaseBufferStackError()
|
||||
nsa void BaseBufferStackError(bool Stack)
|
||||
{
|
||||
/* We don't need to restore the page table
|
||||
because the ExceptionHandlerStub will
|
||||
@ -326,7 +326,7 @@ nsa void BaseBufferStackError()
|
||||
ForceUnlock = true;
|
||||
|
||||
debug("-----------------------------------------------------------------------------------");
|
||||
error("Buffer overflow detected");
|
||||
error("%s", Stack ? "Stack smashing detected" : "Buffer overflow detected");
|
||||
debug("%ld MiB / %ld MiB (%ld MiB Reserved)",
|
||||
TO_MiB(KernelAllocator.GetUsedMemory()),
|
||||
TO_MiB(KernelAllocator.GetTotalMemory()),
|
||||
@ -335,14 +335,14 @@ nsa void BaseBufferStackError()
|
||||
|
||||
nsa __noreturn void HandleStackSmashing()
|
||||
{
|
||||
BaseBufferStackError();
|
||||
BaseBufferStackError(true);
|
||||
DisplayStackSmashing();
|
||||
CPU::Stop();
|
||||
}
|
||||
|
||||
nsa __noreturn void HandleBufferOverflow()
|
||||
{
|
||||
BaseBufferStackError();
|
||||
BaseBufferStackError(false);
|
||||
DisplayBufferOverflow();
|
||||
CPU::Stop();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user