MdeModulePkg/CapsuleApp: Fix potential NULL pointer dereference issue

To avoid potential NULL pointer dereference issue. Initialize them at
the beginning of the function.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Chen A Chen
2019-02-01 10:06:49 +08:00
committed by Liming Gao
parent aad4e2ec8f
commit e98212cb5d
3 changed files with 29 additions and 10 deletions

View File

@@ -795,11 +795,13 @@ DumpCapsuleFromDisk (
UINTN FileCount;
BOOLEAN NoFile;
DirHandle = NULL;
FileHandle = NULL;
Index = 0;
FileCount = 0;
NoFile = FALSE;
DirHandle = NULL;
FileHandle = NULL;
Index = 0;
FileInfoBuffer = NULL;
FileInfo = NULL;
FileCount = 0;
NoFile = FALSE;
Status = Fs->OpenVolume (Fs, &Root);
if (EFI_ERROR (Status)) {
@@ -970,7 +972,10 @@ DumpProvisionedCapsule (
ShellProtocol = GetShellProtocol ();
Index = 0;
Index = 0;
CapsuleDataPtr64 = NULL;
BootNext = NULL;
ShellProtocol = NULL;
//
// Dump capsule provisioned on Memory