MdeModulePkg CapsuleApp: ASSERT to ensure 'CapsuleIndex' is not NULL

Function GetVariable2() ensures its third (output) parameter will not be
NULL when the return status is EFI_SUCCESS.

This commit adds ASSERT as warnings for the case that will not happen.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Hao Wu 2016-11-21 13:44:59 +08:00
parent b43dd22981
commit a522ad7c19
1 changed files with 2 additions and 0 deletions

View File

@ -285,6 +285,7 @@ DmpCapsuleStatusVariable (
NULL
);
if (!EFI_ERROR(Status)) {
ASSERT (CapsuleIndex != NULL);
CopyMem(CapsuleIndexData, CapsuleIndex, 11 * sizeof(CHAR16));
CapsuleIndexData[11] = 0;
Print(L"CapsuleMax - %s\n", CapsuleIndexData);
@ -297,6 +298,7 @@ DmpCapsuleStatusVariable (
NULL
);
if (!EFI_ERROR(Status)) {
ASSERT (CapsuleIndex != NULL);
CopyMem(CapsuleIndexData, CapsuleIndex, 11 * sizeof(CHAR16));
CapsuleIndexData[11] = 0;
Print(L"CapsuleLast - %s\n", CapsuleIndexData);