From: Alan Modra Date: Sat, 4 Jun 2022 09:07:20 +0000 (+0930) Subject: asan: null dereference in coff_count_linenumbers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ae76967be4f05d9171e6e03cb298af648b52899;p=binutils-gdb.git asan: null dereference in coff_count_linenumbers * 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);