diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2022-05-04 17:00:15 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2022-05-04 17:57:58 -0700 |
commit | 18e60f7c8a3a1c250c7eda31c0b9e84fc452829e (patch) | |
tree | eed3a510150869a5054217401428a3118eecafad | |
parent | 4a947dc62f1dea1f19be350e53517f7fc3f54a81 (diff) | |
download | binutils-gdb-18e60f7c8a3a1c250c7eda31c0b9e84fc452829e.tar.gz |
bfd: Check NULL pointer before setting ref_real
PR ld/29086
* linker.c (bfd_wrapped_link_hash_lookup): Check NULL pointer
before setting ref_real.
-rw-r--r-- | bfd/linker.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/linker.c b/bfd/linker.c index e9ebdbad040..0c2e3c10a67 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -599,7 +599,8 @@ bfd_wrapped_link_hash_lookup (bfd *abfd, n[1] = '\0'; strcat (n, l + sizeof REAL - 1); h = bfd_link_hash_lookup (info->hash, n, create, true, follow); - h->ref_real = 1; + if (h != NULL) + h->ref_real = 1; free (n); return h; } |