Layers on top of Firmware Block protocol to produce a file abstraction\r
of FV based files.\r
\r
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
@retval EFI_SUCCESS Successfully read volume header to the allocated\r
buffer.\r
@retval EFI_ACCESS_DENIED Read status of FV is not enabled.\r
+ @retval EFI_INVALID_PARAMETER The FV Header signature is not as expected or\r
+ the file system could not be understood.\r
**/\r
EFI_STATUS\r
GetFwVolHeader (\r
);\r
}\r
\r
+ //\r
+ // Validate FV Header signature, if not as expected, continue.\r
+ //\r
+ if (TempFvh.Signature != EFI_FVH_SIGNATURE) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Check to see that the file system is indeed formatted in a way we can\r
+ // understand it...\r
+ //\r
+ if ((!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&\r
+ (!CompareGuid (&TempFvh.FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
*FwVolHeader = AllocatePool (TempFvh.HeaderLength);\r
if (*FwVolHeader == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
continue;\r
}\r
ASSERT (FwVolHeader != NULL);\r
- //\r
- // Check to see that the file system is indeed formatted in a way we can\r
- // understand it...\r
- //\r
- if ((!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem2Guid)) &&\r
- (!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid))) {\r
- FreePool (FwVolHeader);\r
- continue;\r
- }\r
FreePool (FwVolHeader);\r
\r
Reinstall = FALSE;\r