PR27291, integer overflow in bfd_get_section_contents
authorAlan Modra <amodra@gmail.com>
Wed, 10 Feb 2021 23:23:17 +0000 (09:53 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 11 Feb 2021 01:28:19 +0000 (11:58 +1030)
commit6db658c517bdfbf8e5b8c5a34caf3ff1eea332f1
treec4033214b990c8c2cc35baf32de1e1c1bba9d4d2
parent160fe1933736c123e15199080874fcab8b9ecc65
PR27291, integer overflow in bfd_get_section_contents

Makes the code a little more elegant too.  Note that the unsigned
overflow reported here is well defined so this patch doesn't fix any
real problem.

PR 27291
* section.c (bfd_get_section_contents): Avoid possible overflow
when range checking offset and count.
(bfd_set_section_contents): Likewise.
bfd/ChangeLog
bfd/section.c