forked from Imagelibrary/binutils-gdb
PR binutils/15157
* readelf.c (apply_relocations): Catch relocations with negative offsets.
This commit is contained in:
@@ -10517,7 +10517,7 @@ apply_relocations (void * file,
|
||||
}
|
||||
|
||||
rloc = start + rp->r_offset;
|
||||
if ((rloc + reloc_size) > end)
|
||||
if ((rloc + reloc_size) > end || (rloc < start))
|
||||
{
|
||||
warn (_("skipping invalid relocation offset 0x%lx in section %s\n"),
|
||||
(unsigned long) rp->r_offset,
|
||||
|
||||
Reference in New Issue
Block a user