Fix off-by-one error
This commit is contained in:
parent
865a0f8aa7
commit
9205ac07e3
1 changed files with 2 additions and 2 deletions
|
@ -161,7 +161,7 @@ get_best_header (struct grub_relocator *rel,
|
||||||
{
|
{
|
||||||
grub_addr_t allowable_start, allowable_end;
|
grub_addr_t allowable_start, allowable_end;
|
||||||
allowable_start = (grub_addr_t) h;
|
allowable_start = (grub_addr_t) h;
|
||||||
allowable_end = (grub_addr_t) (h + 1 + h->size);
|
allowable_end = (grub_addr_t) (h + h->size);
|
||||||
|
|
||||||
try_addr (allowable_start, allowable_end);
|
try_addr (allowable_start, allowable_end);
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ malloc_in_range (struct grub_relocator *rel,
|
||||||
|
|
||||||
if (best_addr - (grub_addr_t) hb >= sizeof (*hb))
|
if (best_addr - (grub_addr_t) hb >= sizeof (*hb))
|
||||||
{
|
{
|
||||||
hb->size = ((best_addr - (grub_addr_t) hb) >> GRUB_MM_ALIGN_LOG2) - 1;
|
hb->size = ((best_addr - (grub_addr_t) hb) >> GRUB_MM_ALIGN_LOG2);
|
||||||
if (foll)
|
if (foll)
|
||||||
{
|
{
|
||||||
foll->next = hb;
|
foll->next = hb;
|
||||||
|
|
Loading…
Reference in a new issue