From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 8AA2F3858400 for ; Wed, 5 Jan 2022 10:15:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8AA2F3858400 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C6E2321118; Wed, 5 Jan 2022 10:15:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1641377706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1zODOK6MKajpaeomxDvSuBg5CLhxQQS6TnS3lA0SQhk=; b=ZOrAHP8j2WalfRHr8hh+AucTMeMp/ojSF6vgMp3eKhe1hcGoL15oW9SIq3lAvzBx+eobX/ T1lHLAv9n2aA9vd4zHYl/SkzkPSYpVN52UgcPZ/PYruEzDtw0EIsrvNEk4PZGUvPHhyakc MslOiirFbbMAVrl9CfS/0IxkzFXDBKE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1641377706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1zODOK6MKajpaeomxDvSuBg5CLhxQQS6TnS3lA0SQhk=; b=N7OvFA83UIGo/WVxIES7+1Cl4zz32yJgtePXKXw9z7VtoiUta132r4RlH5tYYsXiHyjDGH RNh9bto1IzzDc0Ag== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A78A413B98; Wed, 5 Jan 2022 10:15:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Y/jVJ6pv1WEsVwAAMHmgww (envelope-from ); Wed, 05 Jan 2022 10:15:06 +0000 Message-ID: Date: Wed, 5 Jan 2022 11:15:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH] gold: fix crash for empty file Content-Language: en-US From: =?UTF-8?Q?Martin_Li=c5=a1ka?= To: binutils@sourceware.org Cc: Ian Lance Taylor References: <68116639-4565-14f5-ce21-6427487b24c1@suse.cz> In-Reply-To: <68116639-4565-14f5-ce21-6427487b24c1@suse.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2022 10:15:08 -0000 PING^2 On 11/29/21 10:00, Martin Liška wrote: > PING^1 > > On 11/19/21 15:01, Martin Liška wrote: >> 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) >