From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web11.4556.1620773793184946230 for ; Tue, 11 May 2021 15:56:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.net header.s=2017 header.b=MTwnmeUV; spf=pass (domain: posteo.net, ip: 185.67.36.66, mailfrom: sergei@posteo.net) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B589D2400FE for ; Wed, 12 May 2021 00:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1620773790; bh=jzSE1SvVbmKVMqi/i1ndywmi2TYjRQGkV9ES5TS5dps=; h=From:To:Cc:Subject:Date:From; b=MTwnmeUVL1P78vklpz8lMWa5RAX0P1otzVNPXDuX2av6ZjVPArK6/x0VnZb1FRdzV Gp442GVlBPvjYljSKqSyYCeDX+lsGymsOCtkIpS4jyHv1mNWdeS8ZnSbnEcRlW2k2l zYu7rZ2crAkd/vnI840v7e7EQZw8PSWnL9WM8sXa8x7NYhe3VZGJlI4KkOmHL6n+gv 0xyhC1Ip0ElOHUs52A31DuNCGmjlCi+/U3djKojbVWB8sWt48uhYTeqsR4kehYnwM7 Gpj+ysIMeRtYhSX4wGTWvB3nACInw5oRRi5i08W+D8mt/P4MdzpS0jqky13vWk63lN RcFJ6UcwlwQjw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FftZj4JSdz9rxL; Wed, 12 May 2021 00:56:29 +0200 (CEST) From: "Sergei Dmitrouk" To: devel@edk2.groups.io Cc: Ray Ni , Zhichao Gao Subject: [PATCH v1 1/2] ShellPkg/UefiShellCommandLib: suppress incorrect gcc warning Date: Tue, 11 May 2021 22:56:15 +0000 Message-Id: <20210511225616.5942-2-sergei@posteo.net> In-Reply-To: <20210511225616.5942-1-sergei@posteo.net> References: <20210511225616.5942-1-sergei@posteo.net> `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. -- 2.17.6