diff options
author | Bret Barkelew <bret@corthon.com> | 2021-04-10 02:25:11 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-04-13 01:24:13 +0000 |
commit | f8e6bcb6e7c350eb7be887dfdb5aad43cd6373af (patch) | |
tree | 80a3c368b3884183e41e02f92e7ac4ec3ee4312a | |
parent | 4b59b22fed05eea1cb92ad90b86759d4bfbc4870 (diff) | |
download | edk2-f8e6bcb6e7c350eb7be887dfdb5aad43cd6373af.zip edk2-f8e6bcb6e7c350eb7be887dfdb5aad43cd6373af.tar.gz edk2-f8e6bcb6e7c350eb7be887dfdb5aad43cd6373af.tar.bz2 |
MdeModulePkg: Initialize temp variable in VarCheckPolicyLib
DumpVariablePolicy() will return EFI_INVALID_PARAMETER if the Buffer
pointer is NULL and the indirect Size is anything but 0. Since this
TempSize was not being initialized it is very likely that this sequence
would not return the total buffer size as expected.
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=3310
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
-rw-r--r-- | MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c index 14e1904..e50edb4 100644 --- a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c +++ b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c @@ -216,6 +216,7 @@ VarCheckPolicyLibMmiHandler ( DumpParamsOut->TotalSize = 0;
DumpParamsOut->PageSize = 0;
DumpParamsOut->HasMore = FALSE;
+ TempSize = 0;
SubCommandStatus = DumpVariablePolicy (NULL, &TempSize);
if (SubCommandStatus == EFI_BUFFER_TOO_SMALL && TempSize > 0) {
mCurrentPaginationCommand = VAR_CHECK_POLICY_COMMAND_DUMP;
|