From: Nick Clifton Date: Fri, 22 Mar 2013 16:04:55 +0000 (+0000) Subject: PR binutils/15157 X-Git-Tag: sid-snapshot-20130401~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8da682327286c0612ddfe3836691b08547bb015;p=external%2Fbinutils.git PR binutils/15157 * readelf.c (apply_relocations): Catch relocations with negative offsets. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 43f490f..e71ec4f 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2013-03-22 Nick Clifton + + PR binutils/15157 + * readelf.c (apply_relocations): Catch relocations with negative + offsets. + 2013-03-15 Nick Clifton * addr2line.c (slurp_symtab): If canonicalization reveals that diff --git a/binutils/readelf.c b/binutils/readelf.c index 266e37e..a7831ef 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -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,