Re: [edk2-devel] [PATCH v1 1/2] ShellPkg/UefiShellCommandLib: suppress incorrect gcc warning

2021-05-14 Thread Laszlo Ersek
On 05/12/21 00:56, Sergei Dmitrouk wrote:
> `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.
> 

Reviewed-by: Laszlo Ersek 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75110): https://edk2.groups.io/g/devel/message/75110
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]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 1/2] ShellPkg/UefiShellCommandLib: suppress incorrect gcc warning

2021-05-11 Thread Sergei Dmitrouk
`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



-=-=-=-=-=-=-=-=-=-=-=-
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]
-=-=-=-=-=-=-=-=-=-=-=-