PR25018, readelf crash on 32bits
authorAlan Modra <amodra@gmail.com>
Sun, 22 Sep 2019 23:23:07 +0000 (08:53 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 25 Sep 2019 00:36:06 +0000 (10:06 +0930)
commita11b3493ca2d5aabdc218197b92026098d7e2f57
treeaa3a688ad92fe18b76b14ef59dba6abd9750241b
parentfdbc0dd57d84d6d57909be2f67c502cebc218fbc
PR25018, readelf crash on 32bits

Pointer comparisons after adding an offset just don't work to catch
overflow when the offset is a larger type than the pointer.

PR 25018
* dwarf.c (get_type_signedness): Delete ineffective pointer
comparison check.  Properly range check uvalue offset on
recursive call.
(read_and_display_attr_value): Range check uvalue offset before
calling get_type_signedness.

(cherry picked from commit b3fe587ed2c78d46132bd33e14f42449d410354b)
binutils/ChangeLog
binutils/dwarf.c