* 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
|
@ -1,3 +1,7 @@
|
|||
2013-10-30 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/mm.c (grub_realloc): Don't copy more data than we have.
|
||||
|
||||
2013-10-30 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/io/gzio.c (huft_build): Use zalloc for safety.
|
||||
|
|
|
@ -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…
Reference in a new issue