public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] PR25842, Null pointer dereference in nm-new
@ 2020-05-02  4:40 gdb-buildbot
  2020-05-02  4:40 ` Failures on Fedora-x86_64-m32, branch master gdb-buildbot
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gdb-buildbot @ 2020-05-02  4:40 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 8d55d10ac0d112c586eaceb92e75bd9b80aadcc4 ***

commit 8d55d10ac0d112c586eaceb92e75bd9b80aadcc4
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Fri Apr 17 08:29:15 2020 +0930
Commit:     Alan Modra <amodra@gmail.com>
CommitDate: Fri Apr 17 10:56:01 2020 +0930

    PR25842, Null pointer dereference in nm-new
    
            PR 25842
            * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
            NULL nodename.

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7f361d7fb1..b9ee79572a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-17  Alan Modra  <amodra@gmail.com>
+
+	PR 25842
+	* elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
+	NULL nodename.
+
 2020-04-16  Nick Clifton  <nickc@redhat.com>
 
 	PR 25803
diff --git a/bfd/elf.c b/bfd/elf.c
index 3d2eee9ea8..f3364eeddf 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1911,8 +1911,12 @@ _bfd_elf_get_symbol_version_string (bfd *abfd, asymbol *symbol,
 	{
 	  const char *nodename
 	    = elf_tdata (abfd)->verdef[vernum - 1].vd_nodename;
-	  version_string = ((base_p || strcmp (symbol->name, nodename))
-			    ? nodename : "");
+	  version_string = "";
+	  if (base_p
+	      || nodename == NULL
+	      || symbol->name == NULL
+	      || strcmp (symbol->name, nodename) != 0)
+	    version_string = nodename;
 	}
       else
 	{


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-07  9:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02  4:40 [binutils-gdb] PR25842, Null pointer dereference in nm-new gdb-buildbot
2020-05-02  4:40 ` Failures on Fedora-x86_64-m32, branch master gdb-buildbot
2020-05-02  5:13 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-05-02  5:20 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-05-02  5:57 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-05-02 17:13 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-05-03 18:10 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2020-05-07  9:03 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot

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).