We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e002d9 commit 19b8fdbCopy full SHA for 19b8fdb
libs/libc/modlib/modlib_bind.c
@@ -333,7 +333,8 @@ static int modlib_relocate(FAR struct module_s *modp,
333
334
/* Calculate the relocation address. */
335
336
- if (rel->r_offset + sizeof(uint32_t) > dstsec->sh_size)
+ if (rel->r_offset < 0 ||
337
+ rel->r_offset > dstsec->sh_size)
338
{
339
berr("ERROR: Section %d reloc %d: "
340
"Relocation address out of range, "
@@ -528,7 +529,8 @@ static int modlib_relocateadd(FAR struct module_s *modp,
528
529
530
531
- if (rela->r_offset + sizeof(uint32_t) > dstsec->sh_size)
532
+ if (rela->r_offset < 0 ||
533
+ rela->r_offset > dstsec->sh_size)
534
535
536
0 commit comments