]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Memory/MemoryServices.c
Update HobLib and Hob Service to avoid data over flow.
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Memory / MemoryServices.c
index ded8754e857dc833f4668b0b071333b3bc698c8d..c7a06a3c5275322cbf6a8cd74079495f547af3f8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EFI PEI Core memory services\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
@@ -249,9 +249,9 @@ PeiAllocatePool (
   \r
   //\r
   // Generally, the size of heap in temporary memory does not exceed to 64K,\r
-  // so the maxmium size of pool is 0x10000 - sizeof (EFI_HOB_MEMORY_POOL)\r
+  // HobLength is multiples of 8 bytes, so the maxmium size of pool is 0xFFF8 - sizeof (EFI_HOB_MEMORY_POOL)\r
   //\r
-  if (Size >= (0x10000 - sizeof (EFI_HOB_MEMORY_POOL))) {\r
+  if (Size > (0xFFF8 - sizeof (EFI_HOB_MEMORY_POOL))) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   \r