]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix null pointer dereference in process_debug_info()
authorNick Clifton <nickc@redhat.com>
Wed, 3 Apr 2024 10:19:33 +0000 (11:19 +0100)
committerNick Clifton <nickc@redhat.com>
Wed, 3 Apr 2024 10:19:33 +0000 (11:19 +0100)
binutils/dwarf.c

index 92a07e00e9b22f6446e465b63dde43613fe9e0db..ce508d0315ff93c85f9d1a692e2d185762ac4c38 100644 (file)
@@ -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;
+                   }
                }
            }