diff --git a/ChangeLog b/ChangeLog index 35847a14c..122283726 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-08 Vladimir Serbinenko + + * grub-core/kern/mm.c (grub_real_malloc): Use AND rather than MOD + for alignment. + 2013-11-08 Vladimir Serbinenko * grub-core/lib/reed_solomon.c (grub_reed_solomon_recover): Add diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c index 5e53b07f4..6111eef7e 100644 --- a/grub-core/kern/mm.c +++ b/grub-core/kern/mm.c @@ -194,7 +194,7 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) { grub_off_t extra; - extra = ((grub_addr_t) (p + 1) >> GRUB_MM_ALIGN_LOG2) % align; + extra = ((grub_addr_t) (p + 1) >> GRUB_MM_ALIGN_LOG2) & (align - 1); if (extra) extra = align - extra;