diff options
author | Alan Modra <amodra@gmail.com> | 2020-01-13 10:10:41 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-01-13 12:12:05 +1030 |
commit | b50ef514ff0c8d5506227c412c508f9f538bcf5a (patch) | |
tree | 3d3b32f21f4277dc3f9e9ba7ead39a105ade7067 /bfd | |
parent | 0c0adcc52478ebb707ed780173e18262df6eab7e (diff) | |
download | binutils-b50ef514ff0c8d5506227c412c508f9f538bcf5a.zip binutils-b50ef514ff0c8d5506227c412c508f9f538bcf5a.tar.gz binutils-b50ef514ff0c8d5506227c412c508f9f538bcf5a.tar.bz2 |
ubsan: alpha-vma: timeout
* vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
for "ignored" records.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/vms-alpha.c | 19 |
2 files changed, 16 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 70944d3..84caf0b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2020-01-13 Alan Modra <amodra@gmail.com> + * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even + for "ignored" records. + +2020-01-13 Alan Modra <amodra@gmail.com> + * wasm-module.c (wasm_scan_name_function_section): Formatting. Delete asect name check. Move asect NULL check to wasm_object_p. Correct bounds check of sizes against end. Replace uses of diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index 73e7285..32f4e68 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -1217,6 +1217,16 @@ _bfd_vms_slurp_egsd (bfd *abfd) return FALSE; } + if (gsd_size < 4) + { + too_small: + _bfd_error_handler (_("corrupt EGSD record type %d: size (%#x) " + "is too small"), + gsd_type, gsd_size); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + switch (gsd_type) { case EGSD__C_PSC: @@ -1227,14 +1237,7 @@ _bfd_vms_slurp_egsd (bfd *abfd) asection *section; if (offsetof (struct vms_egps, flags) + 2 > gsd_size) - { - too_small: - _bfd_error_handler (_("corrupt EGSD record type %d: size (%#x) " - "is too small"), - gsd_type, gsd_size); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } + goto too_small; vms_flags = bfd_getl16 (egps->flags); if ((vms_flags & EGPS__V_REL) == 0) |