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:
parent
16adc27692
commit
0e9b25c23b
@ -673,6 +673,7 @@ Var_UpdateDriverOption (
|
|||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
&DriverOrderListSize
|
&DriverOrderListSize
|
||||||
);
|
);
|
||||||
|
ASSERT (DriverOrderList != NULL);
|
||||||
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
|
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
|
||||||
ASSERT (NewDriverOrderList != NULL);
|
ASSERT (NewDriverOrderList != NULL);
|
||||||
CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
|
CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
|
||||||
@ -842,7 +843,7 @@ Var_UpdateBootOption (
|
|||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
&BootOrderListSize
|
&BootOrderListSize
|
||||||
);
|
);
|
||||||
|
ASSERT (BootOrderList != NULL);
|
||||||
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));
|
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));
|
||||||
ASSERT (NewBootOrderList != NULL);
|
ASSERT (NewBootOrderList != NULL);
|
||||||
CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);
|
CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user