mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcAppleImageVerificationLib: Fix potential memory corruption
The reallocated pointer is not returned and thus lost locally (leak). Because ReallocatePool frees the old buffer on success, the caller pointers are unsafe after calling this function (potential corruption). Because the rest of the buffer is zero'd right before, there should be no security concern keeping the current buffer.
This commit is contained in:
parent
3e9ef5ac41
commit
2ceee875bf
@ -548,14 +548,6 @@ SanitizeApplePeImage (
|
||||
(UINT8 *) Image + *RealImageSize,
|
||||
ImageSize - *RealImageSize
|
||||
);
|
||||
//
|
||||
// Reallocate file buffer
|
||||
//
|
||||
Image = ReallocatePool (
|
||||
ImageSize,
|
||||
*RealImageSize,
|
||||
Image
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user