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

Laszlo Ersek lersek at redhat.com
Fri May 14 09:19:35 UTC 2021


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 <ray.ni at intel.com>
> Cc: Zhichao Gao <zhichao.gao at intel.com>
> Signed-off-by: Sergei Dmitrouk <sergei at 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.
> 

Reviewed-by: Laszlo Ersek <lersek at redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
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/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list