summaryrefslogtreecommitdiff
path: root/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.inf
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2026-09-12 16:26:26 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2026-09-21 11:46:42 +0300
commit5ccee5217c6de6173448920aa0280474b4f44a14 (patch)
tree5837706b2bbb1dba3756c0bd6fa402bc83673711 /UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.inf
parent586194e3067e914a00e06a85960acd71ad688867 (diff)
downloadedk2-5ccee5217c6de6173448920aa0280474b4f44a14.tar.xz
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 <ardb@kernel.org>
Diffstat (limited to 'UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.inf')
0 files changed, 0 insertions, 0 deletions