]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/HobLib.h
Update HobLib and Hob Service to avoid data over flow.
[mirror_edk2.git] / MdePkg / Include / Library / HobLib.h
index 8af7fbe0e1bc4c7e8da1ca5622e00d8d2982cd45..c990076a955c220af250bbbdd9e5722fdcddd881 100644 (file)
@@ -8,7 +8,7 @@
   allows the PEI phase to pass information to the DXE phase. HOBs are position \r
   independent and can be relocated easily to different memory memory locations.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -220,7 +220,8 @@ BuildResourceDescriptorHob (
   \r
   If Guid is NULL, then ASSERT().\r
   If there is no additional space for HOB creation, then ASSERT().\r
-  If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r
+  If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r
+  HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8.\r
 \r
   @param  Guid          The GUID to tag the customized HOB.\r
   @param  DataLength    The size of the data payload for the GUID HOB.\r
@@ -250,7 +251,8 @@ BuildGuidHob (
   If Guid is NULL, then ASSERT().\r
   If Data is NULL and DataLength > 0, then ASSERT().\r
   If there is no additional space for HOB creation, then ASSERT().\r
-  If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r
+  If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r
+  HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8.\r
 \r
   @param  Guid          The GUID to tag the customized HOB.\r
   @param  Data          The data to be copied into the data field of the GUID HOB.\r