diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-07-17 01:50:52 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-07-17 01:50:52 +0000 |
commit | 192764dba9cb61621619cbfbcbfc49834079b8f8 (patch) | |
tree | 0172fab77043758c85a7492b712596a708bf5a46 /MdePkg/Library/DxeCoreHobLib | |
parent | 785d84ead0d7bdba8214f445612eff6d169dea14 (diff) | |
download | edk2-192764dba9cb61621619cbfbcbfc49834079b8f8.zip edk2-192764dba9cb61621619cbfbcbfc49834079b8f8.tar.gz edk2-192764dba9cb61621619cbfbcbfc49834079b8f8.tar.bz2 |
Update HobLib and Hob Service to avoid data over flow.
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Rui Sun <rui.sun@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13532 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/DxeCoreHobLib')
-rw-r--r-- | MdePkg/Library/DxeCoreHobLib/HobLib.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/MdePkg/Library/DxeCoreHobLib/HobLib.c b/MdePkg/Library/DxeCoreHobLib/HobLib.c index 912f97d..afa66b4 100644 --- a/MdePkg/Library/DxeCoreHobLib/HobLib.c +++ b/MdePkg/Library/DxeCoreHobLib/HobLib.c @@ -1,7 +1,7 @@ /** @file
HOB Library implementation for DxeCore driver.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
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
@@ -281,7 +281,8 @@ BuildResourceDescriptorHob ( If Guid is NULL, then ASSERT().
If there is no additional space for HOB creation, then ASSERT().
- If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
+ If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
+ HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8.
@param Guid The GUID to tag the customized HOB.
@param DataLength The size of the data payload for the GUID HOB.
@@ -318,7 +319,8 @@ BuildGuidHob ( If Guid is NULL, then ASSERT().
If Data is NULL and DataLength > 0, then ASSERT().
If there is no additional space for HOB creation, then ASSERT().
- If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
+ If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
+ HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8.
@param Guid The GUID to tag the customized HOB.
@param Data The data to be copied into the data field of the GUID HOB.
|