mirror of https://github.com/acidanthera/audk.git
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:
parent
4cb6375ca6
commit
48c18bd166
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue