[edk2-devel] [PATCH V2 1/2] MdeModulePkg/Variable: Initialize local variable "Variable"

Liming Gao via Groups.Io liming.gao=intel.com at groups.io
Mon Nov 25 14:36:32 UTC 2019


Create PR https://github.com/tianocore/edk2/pull/197, and 
push @290a485d6043a049b611aab30f450c74b8591f35..bd85bf54c268204c7a698a96f3ccd96cd77952cd

Thanks
Liming
> -----Original Message-----
> From: Kubacki, Michael A <michael.a.kubacki at intel.com>
> Sent: Friday, November 22, 2019 7:03 AM
> To: devel at edk2.groups.io
> Cc: Gao, Liming <liming.gao at intel.com>; Kinney, Michael D <michael.d.kinney at intel.com>; Wang, Jian J <jian.j.wang at intel.com>; Wu,
> Hao A <hao.a.wu at intel.com>
> Subject: [PATCH V2 1/2] MdeModulePkg/Variable: Initialize local variable "Variable"
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2364
> 
> Fixes a new build warning in VS2012 introduced in f8ff4cca7c.
> 
> This patch initializes the local variable "Variable" in
> VariableServiceGetNextVariableInternal ().
> 
> This ensures the pointers in the structure are initialized
> in the case no variable stores exist in the list of variable
> stores.
> 
> Cc: Liming Gao <liming.gao at intel.com>
> Cc: Michael D Kinney <michael.d.kinney at intel.com>
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Hao A Wu <hao.a.wu at intel.com>
> Signed-off-by: Michael Kubacki <michael.a.kubacki at intel.com>
> Reviewed-by: Liming Gao <liming.gao at intel.com>
> Reviewed-by: Philippe Mathieu-Daude <philmd at redhat.com>
> Reviewed-by: Jian J Wang <jian.j.wang at intel.com>
> ---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
> index d458f1c608..f6d187543d 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c
> @@ -551,6 +551,8 @@ VariableServiceGetNextVariableInternal (
>      return EFI_INVALID_PARAMETER;
>    }
> 
> +  ZeroMem (&Variable, sizeof (Variable));
> +
>    // Check if the variable exists in the given variable store list
>    for (StoreType = (VARIABLE_STORE_TYPE) 0; StoreType < VariableStoreTypeMax; StoreType++) {
>      if (VariableStoreList[StoreType] == NULL) {
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#51244): https://edk2.groups.io/g/devel/message/51244
Mute This Topic: https://groups.io/mt/61215201/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