summaryrefslogtreecommitdiff
path: root/binutils/debug.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-04-17 10:38:16 +0930
committerAlan Modra <amodra@gmail.com>2020-04-17 10:56:01 +0930
commitca3f923f82a079dcf441419f4a50a50f8b4b33c2 (patch)
tree4d084588182470c5cfd6e6c337401717dc825933 /binutils/debug.c
parentffb60ef355695dad5f7d8f0f7b836ee9f8c07a7e (diff)
downloadbinutils-gdb-ca3f923f82a079dcf441419f4a50a50f8b4b33c2.tar.gz
PR25840, Null pointer dereference in objdump
PR 25840 * debug.c (debug_class_type_samep): Don't segfault on NULL type.
Diffstat (limited to 'binutils/debug.c')
-rw-r--r--binutils/debug.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/binutils/debug.c b/binutils/debug.c
index 022fa4edffb..5470e155edc 100644
--- a/binutils/debug.c
+++ b/binutils/debug.c
@@ -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),