]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg CapsuleApp: ASSERT to ensure 'CapsuleIndex' is not NULL
authorHao Wu <hao.a.wu@intel.com>
Mon, 21 Nov 2016 05:44:59 +0000 (13:44 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 22 Nov 2016 08:31:23 +0000 (16:31 +0800)
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>
MdeModulePkg/Application/CapsuleApp/CapsuleDump.c

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