]> git.proxmox.com Git - grub2.git/commitdiff
* grub-core/kern/mm.c (get_header_from_pointer): Put a more informative
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 22 Jun 2012 21:54:43 +0000 (23:54 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 22 Jun 2012 21:54:43 +0000 (23:54 +0200)
message on double free. Put the value of magic in case of mismatch.

ChangeLog
grub-core/kern/mm.c

index 3b0d41a6f83915dd0e5ec375ef675da9a2879855..5f823b9e1370461d4253cee8f6a94df176bda23a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-22  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/mm.c (get_header_from_pointer): Put a more informative
+       message on double free. Put the value of magic in case of mismatch.
+
 2012-06-22  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Speed-up video on yeeloong.
index 95dd5ddf1dbeb4851067c9138e2e005bf3ae7398..7f240779f832585f743f0c589575f190e33a737d 100644 (file)
@@ -98,8 +98,11 @@ get_header_from_pointer (void *ptr, grub_mm_header_t *p, grub_mm_region_t *r)
     grub_fatal ("out of range pointer %p", ptr);
 
   *p = (grub_mm_header_t) ptr - 1;
+  if ((*p)->magic == GRUB_MM_FREE_MAGIC)
+    grub_fatal ("double free at %p", *p);
   if ((*p)->magic != GRUB_MM_ALLOC_MAGIC)
-    grub_fatal ("alloc magic is broken at %p", *p);
+    grub_fatal ("alloc magic is broken at %p: %lx", *p,
+               (unsigned long) (*p)->magic);
 }
 
 /* Initialize a region starting from ADDR and whose size is SIZE,