mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
* 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.
This commit is contained in:
1 parent
9e86d4c59a
commit
3988c4a09f
2 files changed
+9
-1
No files matched your search
+4
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user