Usermode/libc - Exit on heap corruption
authorJohn Hodge (sonata) <[email protected]>
Mon, 27 May 2013 11:49:40 +0000 (19:49 +0800)
committerJohn Hodge (sonata) <[email protected]>
Mon, 27 May 2013 11:49:40 +0000 (19:49 +0800)
Usermode/Libraries/libc.so_src/heap.c

index bdf64de..1c0c7ac 100644 (file)
@@ -94,13 +94,16 @@ EXPORT void *malloc(size_t bytes)
                        //Corrupt Heap\r
                        Heap_Dump();\r
                        _SysDebug("malloc: Corrupt Heap\n");\r
+                       exit(128);\r
                        return NULL;\r
                }\r
                curBlock = (heap_head*)((uintptr_t)curBlock + curBlock->size);\r
        }\r
        \r
        if((uintptr_t)curBlock < (uintptr_t)_heap_start) {\r
+               Heap_Dump();\r
                _SysDebug("malloc: Heap underrun for some reason\n");\r
+               exit(128);\r
                return NULL;\r
        }\r
        \r

UCC git Repository :: git.ucc.asn.au