`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...@intel.com> Cc: Zhichao Gao <zhichao....@intel.com> Signed-off-by: Sergei Dmitrouk <ser...@posteo.net> --- 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 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75046): https://edk2.groups.io/g/devel/message/75046 Mute This Topic: https://groups.io/mt/82760957/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-