Branch: refs/heads/master
Home: https://github.com/tianocore/edk2
Commit: 5ccee5217c6de6173448920aa0280474b4f44a14
https://github.com/tianocore/edk2/commit/5ccee5217c6de6173448920aa0280474b4f44a14
Author: Ard Biesheuvel <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M MdePkg/Library/BasePrintLib/PrintLibInternal.c
Log Message:
-----------
MdePkg/BasePrintLib: Limit UCS-2 to ASCII conversion to Latin-1
Only ASCII and Latin-1 characters can be cast between CHAR8 and CHAR16
transparently, other characters in the UCS-2 set cannot be represented
at all.
So when handling the %s conversion while generating a narrow string,
replace characters outside of the Latin-1 range with a '?' character
instead of producing garbage output, which may truncate the output
string inadvertently if the UCS-2 low byte happens to equal \0.
When the input and output character widths are the same, the encoding
does not matter and the input can simply be copied to the output.
Signed-off-by: Ard Biesheuvel <[email protected]>
To unsubscribe from these emails, change your notification settings at
https://github.com/tianocore/edk2/settings/notifications
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits