From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web08.6419.1620983983518819720 for ; Fri, 14 May 2021 02:19:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BalkQTA8; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620983982; h=from:from:reply-to:subject:subject: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=w1Zv0eqwTNh/2XB8x6mdJKQj3bSNOib+LpBhscC0kT8=; b=BalkQTA8uDrv3RQYKTjVTxFZuglDoqQ0r4hipAMXbdh0CkM3VqwYb13Cu2Ocz+rEVgoCi3 alJSrIcJ3dkXgIoWuPR4gFLvKzGJtf20YPFO2o1QfdIFEe76f4rfHuYUmaXythYzIYF3uw mWtEteI9Aigj0IZuKfsFQt0JdcFwRpI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-536-OwhtJd-3MLy77OvxH2fdcw-1; Fri, 14 May 2021 05:19:39 -0400 X-MC-Unique: OwhtJd-3MLy77OvxH2fdcw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9D43E1854E27; Fri, 14 May 2021 09:19:38 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-190.ams2.redhat.com [10.36.112.190]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9792A4C; Fri, 14 May 2021 09:19:37 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v1 1/2] ShellPkg/UefiShellCommandLib: suppress incorrect gcc warning To: devel@edk2.groups.io, sergei@posteo.net Cc: Ray Ni , Zhichao Gao References: <20210511225616.5942-1-sergei@posteo.net> <20210511225616.5942-2-sergei@posteo.net> From: "Laszlo Ersek" Message-ID: <4f09e286-1853-148c-9a30-68c735d2d230@redhat.com> Date: Fri, 14 May 2021 11:19:35 +0200 MIME-Version: 1.0 In-Reply-To: <20210511225616.5942-2-sergei@posteo.net> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 05/12/21 00:56, Sergei Dmitrouk wrote: > `Dupes` is used only if `Duplicates != NULL` and function is left if > allocation of memory for `Dupes` fails, so it can't be used > uninitialized. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3228 > Cc: Ray Ni > Cc: Zhichao Gao > Signed-off-by: Sergei Dmitrouk > --- > ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c > index b06d22592d33..81923c8ae737 100644 > --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c > +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c > @@ -2128,6 +2128,11 @@ ShellSortFileList ( > } > } > > + // > + // Set Dupes to suppress incorrect compiler/analyzer warnings. > + // > + Dupes = NULL; > + > // > // If separation of duplicates has been requested, allocate the list for > // them. > Reviewed-by: Laszlo Ersek