PR22307, Heap out of bounds read in _bfd_elf_parse_gnu_properties
authorAlan Modra <amodra@gmail.com>
Tue, 17 Oct 2017 11:27:29 +0000 (21:57 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 17 Oct 2017 11:42:45 +0000 (22:12 +1030)
commitcf54ebff3b7361989712fd9c0128a9b255578163
tree02ff552d81ce251c1ff0eddc51003b932bddee55
parent7b7009999ab8daac9db776c850b7df6e1f586334
PR22307, Heap out of bounds read in _bfd_elf_parse_gnu_properties

When adding an unbounded increment to a pointer, you can't just check
against the end of the buffer but also must check that overflow
doesn't result in "negative" pointer movement.  Pointer comparisons
are signed.  Better, check the increment against the space left using
an unsigned comparison.

PR 22307
* elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
against size left rather than comparing pointers.  Reorganise loop.
bfd/ChangeLog
bfd/elf-properties.c
This page took 0.026101 seconds and 4 git commands to generate.