PR25840, Null pointer dereference in objdump

Alan Modra amodra@gmail.com
Fri Apr 17 01:29:19 GMT 2020


	PR 25840
	* debug.c (debug_class_type_samep): Don't segfault on NULL type.

diff --git a/binutils/debug.c b/binutils/debug.c
index 022fa4edff..5470e155ed 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),

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list