mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
Symptom:Unsafe typecasting may lead to out‑of‑bound memory access RootCause: FileSize, FileLength and SectionLength are declared as UINT32 and masked with 0x00FFFFFF to store only the lower 24 bits. Although this approach yields the correct result, it introduces a potential risk due to unsafe typecasting and dereferencing. Solution: Using the predefined macro FFS_FILE_SIZE() and SECTION_SIZE from MdePkg\Include\Pi\PiFirmwareFile.h, which safely performs the same operation by reconstructing the size using individual byte access. This commit also addresses the fix for coverity issue "OVERRUN" Cc: Sachin Ganesh <sachinganesh@ami.com> Signed-off-by: Gowtham M <gowthamm@ami.com> |
||
|---|---|---|
| .. | ||
| DevicePathTextLib | ||
| DxeCoreTimerLib | ||
| DxeEmuLib | ||
| DxeEmuPeCoffExtraActionLib | ||
| DxeEmuSerialPortLib | ||
| DxeEmuStdErrSerialPortLib | ||
| DxeTimerLib | ||
| GuardUefiMemoryAllocationLib | ||
| KeyMapLibNull | ||
| PeiCoreServicesTablePointerLib | ||
| PeiEmuPeCoffExtraActionLib | ||
| PeiEmuPeCoffGetEntryPointLib | ||
| PeiEmuSerialPortLib | ||
| PeiServicesTablePointerLib | ||
| PeiServicesTablePointerLibMagicPage | ||
| PeiTimerLib | ||
| PlatformBmLib | ||
| RedfishPlatformCredentialLib | ||
| RedfishPlatformHostInterfaceLib | ||
| SecPeiServicesLib | ||
| SecPpiListLib | ||
| SmbiosLib | ||
| ThunkPpiList | ||
| ThunkProtocolList | ||