PR25840, Null pointer dereference in objdump
authorAlan Modra <amodra@gmail.com>
Fri, 17 Apr 2020 01:08:16 +0000 (10:38 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 17 Apr 2020 01:26:01 +0000 (10:56 +0930)
PR 25840
* debug.c (debug_class_type_samep): Don't segfault on NULL type.

binutils/ChangeLog
binutils/debug.c

index 3d83813f296292515328d42c8fed90befc738db2..5c9c18bd52e10b8dc47081f3f871b42540326f0a 100644 (file)
@@ -1,3 +1,8 @@
+2020-04-17  Alan Modra  <amodra@gmail.com>
+
+       PR 25840
+       * debug.c (debug_class_type_samep): Don't segfault on NULL type.
+
 2020-04-16  Alan Modra  <amodra@gmail.com>
 
        * doc/binutils.texi: Mention --no-show-raw-insn in objdump
index 022fa4edffb23381acf0b4b875944fc0bad6f5d3..5470e155edcfe414196516a719c13e9fe11daa92 100644 (file)
@@ -3277,6 +3277,8 @@ debug_class_type_samep (struct debug_handle *info, struct debug_type_s *t1,
              names, since that sometimes fails in the presence of
              typedefs and we really don't care.  */
          if (strcmp (f1->name, f2->name) != 0
+             || f1->type == NULL
+             || f2->type == NULL
              || ! debug_type_samep (info,
                                     debug_get_real_type ((void *) info,
                                                          f1->type, NULL),