aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-03-18 12:35:15 +1030
committerAlan Modra <amodra@gmail.com>2023-03-19 22:19:19 +1030
commit75831f18a0326573a2116e1f57fa5c8e09bd7738 (patch)
treefec80419743223d5f313d0928ab7f94412b4efd4
parent027333da75744bd27e6f05e58ac625f5bf450c8a (diff)
downloadgdb-75831f18a0326573a2116e1f57fa5c8e09bd7738.zip
gdb-75831f18a0326573a2116e1f57fa5c8e09bd7738.tar.gz
gdb-75831f18a0326573a2116e1f57fa5c8e09bd7738.tar.bz2
Another sanity check for read_section_stabs_debugging_info
* rddbg.c (read_section_stabs_debugging_info): Ignore invalid stab sections with size less than 12 bytes.
-rw-r--r--binutils/rddbg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/binutils/rddbg.c b/binutils/rddbg.c
index 1a88877..15081c3 100644
--- a/binutils/rddbg.c
+++ b/binutils/rddbg.c
@@ -119,6 +119,7 @@ read_section_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount,
strsec = bfd_get_section_by_name (abfd, names[i].strsecname);
if (sec != NULL
&& (bfd_section_flags (sec) & SEC_HAS_CONTENTS) != 0
+ && bfd_section_size (sec) >= 12
&& strsec != NULL
&& (bfd_section_flags (strsec) & SEC_HAS_CONTENTS) != 0)
{