]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb, dwarf: add assert to dwarf2_get_pc_bounds
authorNils-Christian Kempke <nils-christian.kempke@intel.com>
Wed, 13 Jul 2022 09:23:36 +0000 (11:23 +0200)
committerIjaz, Abdul B <abdul.b.ijaz@intel.com>
Fri, 29 Dec 2023 10:28:35 +0000 (11:28 +0100)
In dwarf2_get_pc_bounds we were writing unchecked to *lowpc.  This
commit adds a gdb_assert to first check that lowpc != nullptr.

Approved-by: Tom Tromey <tom@tromey.com>
gdb/dwarf2/read.c

index 59a650075756bd97d841cde8942642922174d807..6d958744461065e4834321f20cfb0094a09574b6 100644 (file)
@@ -11092,6 +11092,7 @@ dwarf2_get_pc_bounds (struct die_info *die, unrelocated_addr *lowpc,
       && !per_objfile->per_bfd->has_section_at_zero)
     return PC_BOUNDS_INVALID;
 
+  gdb_assert (lowpc != nullptr);
   *lowpc = low;
   if (highpc != nullptr)
     *highpc = high;