diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-27 09:04:11 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-27 09:04:11 +0000 |
commit | 771ececd1288bb2bee8ea6fee61a1a0220914be5 (patch) | |
tree | 8322a497f5fed08816a28ee95c4d143bb49aa23b /EdkCompatibilityPkg | |
parent | 3978f5d92b31c42c2e6090409d1d83eefdb5face (diff) | |
download | edk2-771ececd1288bb2bee8ea6fee61a1a0220914be5.tar.gz edk2-771ececd1288bb2bee8ea6fee61a1a0220914be5.tar.bz2 edk2-771ececd1288bb2bee8ea6fee61a1a0220914be5.zip |
Add the missing check for NULL pointer before use it.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10116 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c | 7 | ||||
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FvOnFv2Thunk/FvOnFv2Thunk.c | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c index faff074209..f5480d2cb6 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c @@ -1,7 +1,7 @@ /** @file
Parser for IFR binary encoding.
-Copyright (c) 2008, Intel Corporation
+Copyright (c) 2008 - 2010, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -209,6 +209,7 @@ CreateStorage ( FORMSET_STORAGE *Storage;
Storage = AllocateZeroPool (sizeof (FORMSET_STORAGE));
+ ASSERT (Storage != NULL);
Storage->Signature = FORMSET_STORAGE_SIGNATURE;
InsertTailList (&FormSet->StorageListHead, &Storage->Link);
@@ -586,6 +587,7 @@ ParseOpCodes ( // Create a new Form for this FormSet
//
CurrentForm = AllocateZeroPool (sizeof (FORM_BROWSER_FORM));
+ ASSERT (CurrentForm != NULL);
CurrentForm->Signature = FORM_BROWSER_FORM_SIGNATURE;
InitializeListHead (&CurrentForm->StatementListHead);
@@ -701,6 +703,7 @@ ParseOpCodes ( //
case EFI_IFR_DEFAULTSTORE_OP:
DefaultStore = AllocateZeroPool (sizeof (FORMSET_DEFAULTSTORE));
+ ASSERT (DefaultStore != NULL);
DefaultStore->Signature = FORMSET_DEFAULTSTORE_SIGNATURE;
CopyMem (&DefaultStore->DefaultId, &((EFI_IFR_DEFAULTSTORE *) OpCodeData)->DefaultId, sizeof (UINT16));
@@ -917,6 +920,7 @@ ParseOpCodes ( // A Question may have more than one Default value which have different default types.
//
CurrentDefault = AllocateZeroPool (sizeof (QUESTION_DEFAULT));
+ ASSERT (CurrentDefault != NULL);
CurrentDefault->Signature = QUESTION_DEFAULT_SIGNATURE;
CurrentDefault->Value.Type = ((EFI_IFR_DEFAULT *) OpCodeData)->Type;
@@ -940,6 +944,7 @@ ParseOpCodes ( // It create a selection for use in current Question.
//
CurrentOption = AllocateZeroPool (sizeof (QUESTION_OPTION));
+ ASSERT (CurrentOption != NULL);
CurrentOption->Signature = QUESTION_OPTION_SIGNATURE;
CurrentOption->Flags = ((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Flags;
diff --git a/EdkCompatibilityPkg/Compatibility/FvOnFv2Thunk/FvOnFv2Thunk.c b/EdkCompatibilityPkg/Compatibility/FvOnFv2Thunk/FvOnFv2Thunk.c index ff4165d19e..ef64cc84f1 100644 --- a/EdkCompatibilityPkg/Compatibility/FvOnFv2Thunk/FvOnFv2Thunk.c +++ b/EdkCompatibilityPkg/Compatibility/FvOnFv2Thunk/FvOnFv2Thunk.c @@ -7,7 +7,7 @@ these two conditions are true: 1) Framework module consuming FV is present
2) And the platform only produces FV2
-Copyright (c) 2006 - 2008 Intel Corporation. <BR>
+Copyright (c) 2006 - 2010 Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -597,6 +597,7 @@ FvWriteFile ( FirmwareVolume2 = Private->FirmwareVolume2;
PiFileData = AllocateCopyPool (sizeof (EFI_FV_WRITE_FILE_DATA), FileData);
+ ASSERT (PiFileData != NULL);
//
// Framework Spec assume firmware files are Memory-Mapped.
|