PR binutils/15157

* readelf.c (apply_relocations): Catch relocations with negative
	offsets.
This commit is contained in:
Nick Clifton
2013-03-22 16:04:55 +00:00
parent 209be8d2a9
commit c8da682327
2 changed files with 7 additions and 1 deletions

View File

@@ -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,