* grub-core/kern/mm.c (grub_realloc): Don't copy more data than we have.
This commit is contained in:
parent
a602dc5425
commit
b61599aca4
2 changed files with 6 additions and 1 deletions
|
@ -483,7 +483,8 @@ grub_realloc (void *ptr, grub_size_t size)
|
|||
if (! q)
|
||||
return q;
|
||||
|
||||
grub_memcpy (q, ptr, size);
|
||||
/* We've already checked that p->size < n. */
|
||||
grub_memcpy (q, ptr, p->size << GRUB_MM_ALIGN_LOG2);
|
||||
grub_free (ptr);
|
||||
return q;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue