From 48c18bd1663d1a5c84459fe98cd742cc9cbb9562 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Thu, 25 Feb 2016 15:09:39 +0800 Subject: [PATCH] MdeModulePkg: Add ASSERT to make sure pointer 'OptionalData' not be NULL Cc: Liming Gao Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Liming Gao Reviewed-by: Eric Dong --- MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c index 929f38343b..2ecf5b6605 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c @@ -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,