Author: fireball
Date: Wed Jul 2 05:00:12 2008
New Revision: 34256
URL:
http://svn.reactos.org/svn/reactos?rev=34256&view=rev
Log:
- Prevent crashes when heapPtr is NULL, also fix broken heap magic output. Thanks
Mephisto!
Modified:
trunk/reactos/lib/rtl/heap.c
Modified: trunk/reactos/lib/rtl/heap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heap.c?rev=34256&a…
==============================================================================
--- trunk/reactos/lib/rtl/heap.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/heap.c [iso-8859-1] Wed Jul 2 05:00:12 2008
@@ -335,7 +335,10 @@
HEAP *heapPtr = (HEAP *)heap;
if (!heapPtr || (heapPtr->magic != HEAP_MAGIC))
{
- ERR("Invalid heap %p, magic:%4s!\n", heap,heapPtr->magic );
+ if (heapPtr)
+ ERR("Invalid heap %p, magic:%.4s!\n", heap, &heapPtr->magic
);
+ else
+ ERR("Invalid heap %p!\n", heap );
//KeDumpStackFrames(NULL);
return NULL;
}