summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-09 13:37:54 +0000
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-09 13:37:54 +0000
commit18a964cf709bcfe16f98a7019fa46d199b916cc6 (patch)
treea5797de0b41af2e5b21b8091bc74b1e916ecd226 /Tools
parentb244c7dc74ba82c687aa0bb67b52943ed951208e (diff)
downloadedk2-platforms-18a964cf709bcfe16f98a7019fa46d199b916cc6.tar.xz
Increased the image buffer size to avoid invalid address access issue
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2200 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r--Tools/CCode/Source/PeiRebase/PeiRebaseExe.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Tools/CCode/Source/PeiRebase/PeiRebaseExe.c b/Tools/CCode/Source/PeiRebase/PeiRebaseExe.c
index 5f7dfc25c7..e153110c31 100644
--- a/Tools/CCode/Source/PeiRebase/PeiRebaseExe.c
+++ b/Tools/CCode/Source/PeiRebase/PeiRebaseExe.c
@@ -749,14 +749,13 @@ Returns:
// Allocate a buffer for the image to be loaded into.
//
Pe32ImageSize = GetLength (CurrentPe32Section.Pe32Section->CommonHeader.Size) - sizeof (EFI_PE32_SECTION);
- MemoryImagePointer = (UINTN) (malloc (Pe32ImageSize + 0x10000));
+ MemoryImagePointer = (UINTN) (malloc (Pe32ImageSize + 0x100000));
if (MemoryImagePointer == 0) {
Error (NULL, 0, 0, "memory allocation failure", NULL);
return EFI_OUT_OF_RESOURCES;
}
- memset ((void *) MemoryImagePointer, 0, Pe32ImageSize + 0x10000);
+ memset ((void *) MemoryImagePointer, 0, Pe32ImageSize + 0x100000);
MemoryImagePointerAligned = (MemoryImagePointer + 0x0FFFF) & (-1 << 16);
-
ImageContext.ImageAddress = MemoryImagePointerAligned;
@@ -1078,13 +1077,13 @@ Returns:
//
// Allocate a buffer for the image to be loaded into.
//
- MemoryImagePointer = (UINTN) (malloc (Pe32ImageSize + 0x10000));
+ MemoryImagePointer = (UINTN) (malloc (Pe32ImageSize + 0x100000));
if (MemoryImagePointer == 0) {
Error (NULL, 0, 0, "memory allocation error on rebase of TE image", FileGuidString);
free (TEBuffer);
return EFI_OUT_OF_RESOURCES;
}
- memset ((void *) MemoryImagePointer, 0, Pe32ImageSize + 0x10000);
+ memset ((void *) MemoryImagePointer, 0, Pe32ImageSize + 0x100000);
MemoryImagePointerAligned = (MemoryImagePointer + 0x0FFFF) & (-1 << 16);