mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 00:54:06 +02:00
1) Fix buffer overflow in JUMP_BUFFER in the DXE Core StartImage()
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2035 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
8572fea91c
commit
838c84ec7e
@ -953,12 +953,12 @@ Returns:
|
|||||||
// JumpContext must be aligned on a CPU specific boundary.
|
// JumpContext must be aligned on a CPU specific boundary.
|
||||||
// Overallocate the buffer and force the required alignment
|
// Overallocate the buffer and force the required alignment
|
||||||
//
|
//
|
||||||
Image->JumpBuffer = CoreAllocateBootServicesPool (sizeof (*Image->JumpContext) + BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT);
|
Image->JumpBuffer = CoreAllocateBootServicesPool (sizeof (BASE_LIBRARY_JUMP_BUFFER) + BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT);
|
||||||
if (Image->JumpBuffer == NULL) {
|
if (Image->JumpBuffer == NULL) {
|
||||||
PERF_END (ImageHandle, START_IMAGE_TOK, NULL, 0);
|
PERF_END (ImageHandle, START_IMAGE_TOK, NULL, 0);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
Image->JumpContext = (VOID *)((UINTN)(ALIGN_POINTER (Image->JumpBuffer, BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT)) + BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT);
|
Image->JumpContext = ALIGN_POINTER (Image->JumpBuffer, BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT);
|
||||||
|
|
||||||
SetJumpFlag = SetJump (Image->JumpContext);
|
SetJumpFlag = SetJump (Image->JumpContext);
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user