aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-06-04 18:37:20 +0930
committerAlan Modra <amodra@gmail.com>2022-06-04 20:57:36 +0930
commit3ae76967be4f05d9171e6e03cb298af648b52899 (patch)
tree97e2cb8062d6563f3bc7b891ddac07721ff79dfa
parent21aacea42ecaa7aca9b686e8de0f79a1f4e7d668 (diff)
downloadgdb-3ae76967be4f05d9171e6e03cb298af648b52899.zip
gdb-3ae76967be4f05d9171e6e03cb298af648b52899.tar.gz
gdb-3ae76967be4f05d9171e6e03cb298af648b52899.tar.bz2
asan: null dereference in coff_count_linenumbers
* coffgen.c (coff_count_linenumbers): Don't segfault when asymbol the_bfd is NULL.
-rw-r--r--bfd/coffgen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index c693cfc..07b3fb4 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);