diff options
author | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-23 13:16:32 +0000 |
---|---|---|
committer | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-23 13:16:32 +0000 |
commit | 33f201a09c272685491504b3604001c362ff06e3 (patch) | |
tree | 0b393be0b38a0c47ab72d881bf796cdb9dd07e96 /IntelFrameworkModulePkg/Universal | |
parent | 261136bc32b456800f6dec7eedadea5b2a153eca (diff) | |
download | edk2-platforms-33f201a09c272685491504b3604001c362ff06e3.tar.xz |
Fix the issue that VariablePei hangs on Richford when variable region is wiped out.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7927 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/VariablePei/Variable.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c b/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c index aa43ae1512..844987bd0e 100644 --- a/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c +++ b/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c @@ -1,7 +1,7 @@ /** @file
Framework PEIM to provide the Variable functionality
-Copyright (c) 2006 - 2008 Intel Corporation. <BR>
+Copyright (c) 2006 - 2009 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
@@ -426,6 +426,14 @@ FindVariable ( Variable = IndexTable->StartPtr;
} else {
VariableBase = (UINT8 *) (UINTN) PcdGet32 (PcdFlashNvStorageVariableBase);
+
+ //
+ // Check if FV header is valid.
+ //
+ if (((EFI_FIRMWARE_VOLUME_HEADER *) VariableBase)->Signature != EFI_FVH_SIGNATURE) {
+ return EFI_UNSUPPORTED;
+ }
+
VariableStoreHeader = (VARIABLE_STORE_HEADER *) (VariableBase + \
((EFI_FIRMWARE_VOLUME_HEADER *) (VariableBase)) -> HeaderLength);
|