public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* asan: null dereference in coff_count_linenumbers
@ 2022-06-04 11:27 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-06-04 11:27 UTC (permalink / raw)
  To: binutils

	* coffgen.c (coff_count_linenumbers): Don't segfault when asymbol
	the_bfd is NULL.

diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index c693cfc00cb..07b3fb446aa 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -595,7 +595,8 @@ coff_count_linenumbers (bfd *abfd)
     {
       asymbol *q_maybe = *p;
 
-      if (bfd_family_coff (bfd_asymbol_bfd (q_maybe)))
+      if (bfd_asymbol_bfd (q_maybe) != NULL
+	  && bfd_family_coff (bfd_asymbol_bfd (q_maybe)))
 	{
 	  coff_symbol_type *q = coffsymbol (q_maybe);
 

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-04 11:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-04 11:27 asan: null dereference in coff_count_linenumbers Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).