summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorSergei Dmitrouk <sergei@posteo.net>2021-05-11 22:56:15 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-05-14 10:00:13 +0000
commiteec44cdd0058ad208fa730796a306eae9138db58 (patch)
treea653c0775cc5da0f49be4e60bc95f3da2e5fdf5a /ShellPkg
parent22ac5cc9d9db34056f7c97e994fd9def683ebb2e (diff)
downloadedk2-eec44cdd0058ad208fa730796a306eae9138db58.tar.gz
edk2-eec44cdd0058ad208fa730796a306eae9138db58.tar.bz2
edk2-eec44cdd0058ad208fa730796a306eae9138db58.zip
ShellPkg/UefiShellCommandLib: suppress incorrect gcc warning
`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 <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sergei Dmitrouk <sergei@posteo.net> Message-Id: <20210511225616.5942-2-sergei@posteo.net> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
index b06d22592d..81923c8ae7 100644
--- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
+++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
@@ -2129,6 +2129,11 @@ ShellSortFileList (
}
//
+ // Set Dupes to suppress incorrect compiler/analyzer warnings.
+ //
+ Dupes = NULL;
+
+ //
// If separation of duplicates has been requested, allocate the list for
// them.
//