mirror of https://github.com/acidanthera/audk.git
MdePkg: Improving readability of CVE patch for PeCoffLoaderRelocateImage
This change adds parantheses to the if condition detecting overflow in the PeCoffLoaderRelocateImage function to improve readability. Follow on change for: REF!: https://github.com/tianocore/edk2/pull/6249 Signed-off-by: Doug Flick <dougflick@microsoft.com>
This commit is contained in:
parent
cac73c45c4
commit
e73ec56942
|
@ -1054,7 +1054,7 @@ PeCoffLoaderRelocateImage (
|
|||
RelocDir = &Hdr.Te->DataDirectory[0];
|
||||
}
|
||||
|
||||
if ((RelocDir != NULL) && (RelocDir->Size > 0) && (RelocDir->Size - 1 < MAX_UINT32 - RelocDir->VirtualAddress)) {
|
||||
if ((RelocDir != NULL) && (RelocDir->Size > 0) && ((RelocDir->Size - 1) < (MAX_UINT32 - RelocDir->VirtualAddress))) {
|
||||
RelocBase = (EFI_IMAGE_BASE_RELOCATION *)PeCoffLoaderImageAddress (ImageContext, RelocDir->VirtualAddress, TeStrippedOffset);
|
||||
RelocBaseEnd = (EFI_IMAGE_BASE_RELOCATION *)PeCoffLoaderImageAddress (
|
||||
ImageContext,
|
||||
|
|
Loading…
Reference in New Issue