mirror of
https://github.com/acidanthera/audk.git
synced 2025-09-23 17:57:45 +02:00
ImageTool: Ensure PE section names are terminated
This commit is contained in:
parent
e239aed80d
commit
8db3b2a6a2
@ -53,7 +53,13 @@ InternalFinalizeExtraSection (
|
|||||||
|
|
||||||
assert (Size == ImageToolBufferGetSize (Buffer) - Offset);
|
assert (Size == ImageToolBufferGetSize (Buffer) - Offset);
|
||||||
|
|
||||||
strncpy ((char *)SectionHeader->Name, Name, sizeof (SectionHeader->Name));
|
strncpy (
|
||||||
|
(char *)SectionHeader->Name,
|
||||||
|
Name,
|
||||||
|
sizeof (SectionHeader->Name)
|
||||||
|
);
|
||||||
|
SectionHeader->Name[ARRAY_SIZE (SectionHeader->Name) - 1] = 0;
|
||||||
|
|
||||||
SectionHeader->VirtualSize = ALIGN_VALUE (Size, PeHdr->SectionAlignment);
|
SectionHeader->VirtualSize = ALIGN_VALUE (Size, PeHdr->SectionAlignment);
|
||||||
SectionHeader->VirtualAddress = PeHdr->SizeOfImage;
|
SectionHeader->VirtualAddress = PeHdr->SizeOfImage;
|
||||||
SectionHeader->SizeOfRawData = ALIGN_VALUE (Size, PeHdr->FileAlignment);
|
SectionHeader->SizeOfRawData = ALIGN_VALUE (Size, PeHdr->FileAlignment);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user