summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-11-21 13:44:59 +0800
committerHao Wu <hao.a.wu@intel.com>2016-11-22 16:31:23 +0800
commita522ad7c192b5cf3b31d3152eb082236fbda7243 (patch)
tree40cc018e641f8417dc4bd03c9340af1439bb2c40 /MdeModulePkg/Application
parentb43dd22981b71dd78dd4cc04d55dc23d81c3bafb (diff)
downloadedk2-a522ad7c192b5cf3b31d3152eb082236fbda7243.tar.gz
edk2-a522ad7c192b5cf3b31d3152eb082236fbda7243.tar.bz2
edk2-a522ad7c192b5cf3b31d3152eb082236fbda7243.zip
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>
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/CapsuleApp/CapsuleDump.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
index 9291ba3af3..d09b938fed 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
@@ -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);