From 5b214888aa5b1553d5286356bd04f0908aab2185 Mon Sep 17 00:00:00 2001 From: anjiahao <75056955+anjiahao1@users.noreply.github.com> Date: Fri, 1 Apr 2022 20:30:03 +0800 Subject: [PATCH] Update libs/libc/modlib/modlib_bind.c Co-authored-by: Petro Karashchenko --- libs/libc/modlib/modlib_bind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libc/modlib/modlib_bind.c b/libs/libc/modlib/modlib_bind.c index 17f7e5f28a6..925902ffbfc 100644 --- a/libs/libc/modlib/modlib_bind.c +++ b/libs/libc/modlib/modlib_bind.c @@ -486,7 +486,7 @@ static int modlib_relocateadd(FAR struct module_s *modp, /* Calculate the relocation address. */ if (rela->r_offset || - rela->r_offset > dstsec->sh_size - sizeof(uint32_t)) + rela->r_offset + sizeof(uint32_t) > dstsec->sh_size) { berr("ERROR: Section %d reloc %d: " "Relocation address out of range, "