From: John Hodge (sonata) Date: Mon, 27 May 2013 11:49:40 +0000 (+0800) Subject: Usermode/libc - Exit on heap corruption X-Git-Tag: rel0.15~292^2~9 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=847cf5210b02bfef53758f0e0f49c0f2990a2a09;p=tpg%2Facess2.git Usermode/libc - Exit on heap corruption --- diff --git a/Usermode/Libraries/libc.so_src/heap.c b/Usermode/Libraries/libc.so_src/heap.c index bdf64de3..1c0c7acf 100644 --- a/Usermode/Libraries/libc.so_src/heap.c +++ b/Usermode/Libraries/libc.so_src/heap.c @@ -94,13 +94,16 @@ EXPORT void *malloc(size_t bytes) //Corrupt Heap Heap_Dump(); _SysDebug("malloc: Corrupt Heap\n"); + exit(128); return NULL; } curBlock = (heap_head*)((uintptr_t)curBlock + curBlock->size); } if((uintptr_t)curBlock < (uintptr_t)_heap_start) { + Heap_Dump(); _SysDebug("malloc: Heap underrun for some reason\n"); + exit(128); return NULL; }