]> xenbits.xensource.com Git - people/aperard/ovmf.git/commitdiff
ShellPkg/UefiShellCommandLib: suppress incorrect gcc warning
authorSergei Dmitrouk <sergei@posteo.net>
Tue, 11 May 2021 22:56:15 +0000 (22:56 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 14 May 2021 10:00:13 +0000 (10:00 +0000)
`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>
ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c

index b06d22592d33df8fa136c34f22ba93f2939c13e1..81923c8ae7373ee4fca40d88898b9a7b67b5f679 100644 (file)
@@ -2128,6 +2128,11 @@ ShellSortFileList (
     }\r
   }\r
 \r
+  //\r
+  // Set Dupes to suppress incorrect compiler/analyzer warnings.\r
+  //\r
+  Dupes = NULL;\r
+\r
   //\r
   // If separation of duplicates has been requested, allocate the list for\r
   // them.\r