aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2024-04-03 11:19:33 +0100
committerNick Clifton <nickc@redhat.com>2024-04-03 11:19:33 +0100
commit301bfc45abb5ea2824a4d1820183b58d0d67357d (patch)
treee13025d14d7e612293154230909b8812a5f5f831 /binutils
parent28b24770bb7b8dc0c79121bdaa64303d17693669 (diff)
downloadgdb-301bfc45abb5ea2824a4d1820183b58d0d67357d.zip
gdb-301bfc45abb5ea2824a4d1820183b58d0d67357d.tar.gz
gdb-301bfc45abb5ea2824a4d1820183b58d0d67357d.tar.bz2
Fix null pointer dereference in process_debug_info()
Diffstat (limited to 'binutils')
-rw-r--r--binutils/dwarf.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 92a07e0..ce508d0 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -4248,14 +4248,17 @@ process_debug_info (struct dwarf_section * section,
compunit.cu_version,
debug_info_p);
- /* This check was in place before, keep it. */
- stemp = debug_info_p->rnglists_base;
- if (stemp < 0)
+ if (debug_info_p)
{
- warn (_("CU @ %#" PRIx64 " has has a negative rnglists_base "
- "value of %#" PRIx64 " - treating as zero"),
- debug_info_p->cu_offset, stemp);
- debug_info_p->rnglists_base = 0;
+ /* This check was in place before, keep it. */
+ stemp = debug_info_p->rnglists_base;
+ if (stemp < 0)
+ {
+ warn (_("CU @ %#" PRIx64 " has has a negative rnglists_base "
+ "value of %#" PRIx64 " - treating as zero"),
+ debug_info_p->cu_offset, stemp);
+ debug_info_p->rnglists_base = 0;
+ }
}
}