From c65f94a07aee0c1c6745e079a613f2fefa79a657 Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Wed, 22 Feb 2023 09:57:53 +1030
Subject: [PATCH] Re: objdump read_section_stabs

Also fix ubsan "applying zero offset to null pointer".

	* objdump.c (print_section_stabs): Avoid ubsan warning.
---
 binutils/objdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/binutils/objdump.c b/binutils/objdump.c
index 40ed6882b45..d00eed054c4 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -4499,7 +4499,7 @@ print_section_stabs (bfd *abfd,
   bfd_byte *stabp, *stabs_end;
 
   stabp = stabs;
-  stabs_end = stabp + stab_size;
+  stabs_end = PTR_ADD (stabp, stab_size);
 
   printf (_("Contents of %s section:\n\n"), sanitize_string (stabsect_name));
   printf ("Symnum n_type n_othr n_desc n_value  n_strx String\n");