ArmPlatformPkg/Bds: Check OptionalData is not NULL before accessing it

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15439 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Olivier Martin 2014-04-08 18:05:48 +00:00 committed by oliviermartin
parent 1dbbfc176f
commit 734b6c33ba
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,10 @@
#define ARM_BDS_OPTIONAL_DATA_SIGNATURE SIGNATURE_32('a', 'b', 'o', 'd')
#define IS_ARM_BDS_BOOTENTRY(ptr) (ReadUnaligned32 ((CONST UINT32*)&((ARM_BDS_LOADER_OPTIONAL_DATA*)((ptr)->OptionalData))->Header.Signature) == ARM_BDS_OPTIONAL_DATA_SIGNATURE)
#define IS_ARM_BDS_BOOTENTRY(ptr) \
(((ptr)->OptionalData != NULL) && \
(ReadUnaligned32 ((CONST UINT32*)&((ARM_BDS_LOADER_OPTIONAL_DATA*)((ptr)->OptionalData))->Header.Signature) \
== ARM_BDS_OPTIONAL_DATA_SIGNATURE))
#define UPDATE_BOOT_ENTRY L"Update entry: "
#define DELETE_BOOT_ENTRY L"Delete entry: "