From: Nick Clifton Date: Wed, 3 Apr 2024 10:19:33 +0000 (+0100) Subject: Fix null pointer dereference in process_debug_info() X-Git-Tag: gdb-15-branchpoint~509 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=301bfc45abb5ea2824a4d1820183b58d0d67357d;p=thirdparty%2Fbinutils-gdb.git Fix null pointer dereference in process_debug_info() --- diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 92a07e00e9b..ce508d0315f 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; + } } }