From 38b7a3026900670159f299f2daa7e35957752942 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 26 Feb 2015 22:10:29 +0100 Subject: [PATCH] arm/dl: Fix handling of nonstandard relocation sizes --- grub-core/kern/arm/dl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/kern/arm/dl.c b/grub-core/kern/arm/dl.c index 5cbd65e46..24364e189 100644 --- a/grub-core/kern/arm/dl.c +++ b/grub-core/kern/arm/dl.c @@ -78,9 +78,9 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp, const Elf_Rel *rel, *max; for (rel = (const Elf_Rel *) ((grub_addr_t) e + s->sh_offset), - max = rel + s->sh_size / s->sh_entsize; - rel < max; - rel++) + max = (const Elf_Rel *) ((grub_addr_t) rel + s->sh_size); + rel + 1 <= max; + rel = (const Elf_Rel *) ((grub_addr_t) rel + s->sh_entsize)) switch (ELF_R_TYPE (rel->r_info)) { case R_ARM_CALL: