forked from Bananymous/banan-os
Kernel: kmalloc now returns nullptr if you try to allocate over kmalloc size
This commit is contained in:
@@ -98,7 +98,7 @@ void* kmalloc(size_t size)
|
|||||||
|
|
||||||
void* kmalloc(size_t size, size_t align)
|
void* kmalloc(size_t size, size_t align)
|
||||||
{
|
{
|
||||||
if (size == 0)
|
if (size == 0 || size >= s_kmalloc_size)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
if (align == 0)
|
if (align == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user