PR24272, out-of-bounds read in pex64_xdata_print_uwd_codes
authorAlan Modra <amodra@gmail.com>
Thu, 28 Feb 2019 22:58:47 +0000 (09:28 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 1 Mar 2019 03:00:38 +0000 (13:30 +1030)
commitb24cc4146e4de9f3b66e2e2fb8379db46eff89c9
tree42abb0936ca9a71b8901ea94202d75b4f94c8527
parentb09e83c1f814a6f218519abeb94aaf45869ba03c
PR24272, out-of-bounds read in pex64_xdata_print_uwd_codes

The fix here is to use an unsigned comparison for
    if (a->NumberOfRvaAndSizes > IMAGE_NUMBEROF_DIRECTORY_ENTRIES)

include/
PR 24272
* coff/internal.h (struct internal_extra_pe_aouthdr): Change type
of SizeOfCode, SizeOfInitializedData, and SizeOfUninitializedData
to bfd_vma.  Change type of SectionAlignment, FileAlignment,
Reserved1, SizeOfImage, SizeOfHeaders, CheckSum, LoaderFlags,
and NumberOfRvaAndSizes to uint32_t.
bfd/
PR 24272
* peXXigen.c (_bfd_XXi_swap_aouthdr_in): Use unsigned index.
(_bfd_XX_print_private_bfd_data_common): Adjust for type changes.
bfd/peXXigen.c
include/coff/internal.h