]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR 33021, buffer overflow in write_dwarf_eh_frame_hdr
authorAlan Modra <amodra@gmail.com>
Wed, 28 May 2025 05:42:39 +0000 (15:12 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 28 May 2025 05:56:01 +0000 (15:26 +0930)
* elf-eh-frame.c (write_dwarf_eh_frame_hdr): Use size of
contents, not section size, in bfd_set_section_contents call.

bfd/elf-eh-frame.c

index 78b3ecb5a7db42480b382356d81d3ff6a1de58b7..0250a8f8d116c02ab64d13a8bba5287df7467665 100644 (file)
@@ -2506,7 +2506,7 @@ write_dwarf_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
   /* FIXME: octets_per_byte.  */
   if (!bfd_set_section_contents (abfd, sec->output_section, contents,
                                 (file_ptr) sec->output_offset,
-                                sec->size))
+                                size))
     retval = false;
  out:
   free (contents);