MdeModulePkg/CapsuleApp: Fix potential NULL pointer dereference issue
To avoid potential NULL pointer dereference issue. Initialize them at
the beginning of the function. This patch is a supplement which was missed
at e98212cb5d
commit.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
This commit is contained in:
@ -445,7 +445,10 @@ GetUpdateFileSystem (
|
||||
(VOID **)&BootNextData,
|
||||
NULL
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
if (EFI_ERROR (Status) || BootNextData == NULL) {
|
||||
Print (L"Get Boot Next Data Fail. Status = %r\n", Status);
|
||||
return EFI_NOT_FOUND;
|
||||
} else {
|
||||
UnicodeSPrint (BootOptionName, sizeof (BootOptionName), L"Boot%04x", *BootNextData);
|
||||
Status = EfiBootManagerVariableToLoadOption (BootOptionName, &BootNextOption);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
|
Reference in New Issue
Block a user