Add pointer check for NULL before dereference it.

Signed-off-by: ydong10
Reviewed-by: vanjeff

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12474 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2011-09-29 06:38:55 +00:00
parent 16adc27692
commit 0e9b25c23b
1 changed files with 2 additions and 1 deletions

View File

@ -673,6 +673,7 @@ Var_UpdateDriverOption (
&gEfiGlobalVariableGuid,
&DriverOrderListSize
);
ASSERT (DriverOrderList != NULL);
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
ASSERT (NewDriverOrderList != NULL);
CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
@ -842,7 +843,7 @@ Var_UpdateBootOption (
&gEfiGlobalVariableGuid,
&BootOrderListSize
);
ASSERT (BootOrderList != NULL);
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));
ASSERT (NewBootOrderList != NULL);
CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);