MdeModulePkg: Add ASSERT to make sure pointer 'OptionalData' not be NULL

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
Dandan Bi 2016-02-25 15:09:39 +08:00 committed by Star Zeng
parent 4cb6375ca6
commit 48c18bd166
1 changed files with 2 additions and 0 deletions

View File

@ -614,6 +614,7 @@ Var_UpdateDriverOption (
if (OptionalDataExist) {
NewLoadContext->OptionalData = AllocateZeroPool (LoadOption.OptionalDataSize);
ASSERT (NewLoadContext->OptionalData != NULL);
CopyMem (
NewLoadContext->OptionalData,
LoadOption.OptionalData,
@ -725,6 +726,7 @@ Var_UpdateBootOption (
if (OptionalDataExist) {
NewLoadContext->OptionalData = AllocateZeroPool (LoadOption.OptionalDataSize);
ASSERT (NewLoadContext->OptionalData != NULL);
CopyMem (
NewLoadContext->OptionalData,
LoadOption.OptionalData,