PR22239 - invalid memory read in display_debug_frames
authorAlan Modra <amodra@gmail.com>
Thu, 5 Oct 2017 07:02:18 +0000 (17:32 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 5 Oct 2017 07:13:34 +0000 (17:43 +1030)
commit9c0f3d3f2017829ffd908c9893b85094985c3b58
tree5923acc679c5289d96b9e10c2feec203eb808c57
parentc91933e9e33654c7b8973cb449b93f5152afcbcb
PR22239 - invalid memory read in display_debug_frames

Pointer comparisons have traps for the unwary.  After adding a large
unknown value to "start", the test "start < end" depends on where
"start" is originally in memory.

PR 22239
* dwarf.c (read_cie): Don't compare "start" and "end" pointers
after adding a possibly wild length to "start", compare the length
to the difference of the pointers instead.  Remove now redundant
"negative" length test.
binutils/ChangeLog
binutils/dwarf.c