asan: null dereference in coff_count_linenumbers

* coffgen.c (coff_count_linenumbers): Don't segfault when asymbol
	the_bfd is NULL.
This commit is contained in:
Alan Modra
2022-06-04 18:37:20 +09:30
parent 21aacea42e
commit 3ae76967be

View File

@@ -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);