]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR31873, buffer overflow in evax_bfd_print_dst
authorAlan Modra <amodra@gmail.com>
Mon, 10 Jun 2024 13:20:26 +0000 (22:50 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 10 Jun 2024 13:23:11 +0000 (22:53 +0930)
PR 31873
* vms-alpha.c (evax_bfd_print_dst): Sanity check len against
dst_size.

bfd/vms-alpha.c

index 404638cf3d9581df89afdcd5a875c72d28857757..337523015dc53522aa53e57dee824e410ca36608 100644 (file)
@@ -7511,6 +7511,8 @@ evax_bfd_print_dst (struct bfd *abfd, unsigned int dst_size, FILE *file)
       /* xgettext:c-format */
       fprintf (file, _(" type: %3u, len: %3u (at 0x%08x): "),
               type, len, off);
+      if (len > dst_size)
+       len = dst_size;
       if (len < sizeof (dsth))
        {
          fputc ('\n', file);