public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gold: fix crash for empty file
@ 2021-11-19 14:01 Martin Liška
  2021-11-29  9:00 ` Martin Liška
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Liška @ 2021-11-19 14:01 UTC (permalink / raw)
  To: binutils; +Cc: ccoutant, Ian Lance Taylor

Hi.

The patch fixes a crash I noticed and explained in the linked PR.

Patch survives regression tests.

Ready to be installed?
Thanks,
Martin

gold/ChangeLog:

	PR 28585
	* symtab.cc (Symbol_table::lookup): Return NULL for NULL
	argument.
---
  gold/symtab.cc | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/gold/symtab.cc b/gold/symtab.cc
index 5a21ddc8cc2..ed6b5434592 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -701,6 +701,8 @@ Symbol_table::resolve_forwards(const Symbol* from) const
  Symbol*
  Symbol_table::lookup(const char* name, const char* version) const
  {
+  if (name == NULL)
+    return NULL;
    Stringpool::Key name_key;
    name = this->namepool_.find(name, &name_key);
    if (name == NULL)
-- 
2.33.1


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

end of thread, other threads:[~2022-01-06  8:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19 14:01 [PATCH] gold: fix crash for empty file Martin Liška
2021-11-29  9:00 ` Martin Liška
2022-01-05 10:15   ` Martin Liška
2022-01-05 17:35     ` Cary Coutant
2022-01-06  8:35       ` Martin Liška

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