From c7badac60188cf1987f58c2d8f69a1da33ffe1bc Mon Sep 17 00:00:00 2001 From: anjiahao <75056955+anjiahao1@users.noreply.github.com> Date: Fri, 1 Apr 2022 20:22:02 +0800 Subject: [PATCH] Update libs/libc/modlib/modlib_bind.c u are right 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 a4ad23c762..17f7e5f28a 100644 --- a/libs/libc/modlib/modlib_bind.c +++ b/libs/libc/modlib/modlib_bind.c @@ -298,7 +298,7 @@ static int modlib_relocate(FAR struct module_s *modp, /* Calculate the relocation address. */ if (rel->r_offset || - rel->r_offset > dstsec->sh_size - sizeof(uint32_t)) + rel->r_offset + sizeof(uint32_t) > dstsec->sh_size) { berr("ERROR: Section %d reloc %d: " "Relocation address out of range, "