mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
MdeModulePkg/ImagePropertiesRecordLib: Fix incorrect use of sizeof
In GetFilename(), the post-loop fallback termination used sizeof (EfiFileName), which is the size of the CHAR8 * pointer parameter (8 bytes on X64), not the buffer size. Use EfiFileNameSize - 4 to match the bound of the copy loop above so the string is terminated at the true end of the buffer. Tested on OvmfPkgIa32X64, DEBUG, GCC: DumpImageRecords() prints all runtime image names correctly and NUL-terminated, with no ASSERTs. Signed-off-by: Mingjie Shen <shen497@purdue.edu>
This commit is contained in:
parent
cc9a0425a2
commit
0fef1e5570
1 changed files with 1 additions and 1 deletions
|
|
@ -864,7 +864,7 @@ GetFilename (
|
|||
}
|
||||
}
|
||||
|
||||
if (Index == sizeof (EfiFileName) - 4) {
|
||||
if (Index == EfiFileNameSize - 4) {
|
||||
EfiFileName[Index] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue