diff options
author | Sergei Dmitrouk <sergei@posteo.net> | 2021-05-11 22:56:15 +0000 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-05-14 10:00:13 +0000 |
commit | eec44cdd0058ad208fa730796a306eae9138db58 (patch) | |
tree | a653c0775cc5da0f49be4e60bc95f3da2e5fdf5a | |
parent | 22ac5cc9d9db34056f7c97e994fd9def683ebb2e (diff) | |
download | edk2-eec44cdd0058ad208fa730796a306eae9138db58.zip edk2-eec44cdd0058ad208fa730796a306eae9138db58.tar.gz edk2-eec44cdd0058ad208fa730796a306eae9138db58.tar.bz2 |
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>
-rw-r--r-- | ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c index b06d225..81923c8 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.
//
|