Message ID | 20250305022154.3903128-1-ming.lei@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [V3] block: fix conversion of GPT partition name to 7-bit | expand |
Context | Check | Description |
---|---|---|
shin/vmtest-linus-master-PR | success | PR summary |
shin/vmtest-linus-master-VM_Test-0 | success | Logs for build-kernel |
On Wed, 05 Mar 2025 10:21:54 +0800, Ming Lei wrote: > The utf16_le_to_7bit function claims to, naively, convert a UTF-16 > string to a 7-bit ASCII string. By naively, we mean that it: > * drops the first byte of every character in the original UTF-16 string > * checks if all characters are printable, and otherwise replaces them > by exclamation mark "!". > > This means that theoretically, all characters outside the 7-bit ASCII > range should be replaced by another character. Examples: > > [...] Applied, thanks! [1/1] block: fix conversion of GPT partition name to 7-bit (no commit info) Best regards,
diff --git a/block/partitions/efi.c b/block/partitions/efi.c index 5e9be13a56a8..7acba66eed48 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c @@ -682,7 +682,7 @@ static void utf16_le_to_7bit(const __le16 *in, unsigned int size, u8 *out) out[size] = 0; while (i < size) { - u8 c = le16_to_cpu(in[i]) & 0xff; + u8 c = le16_to_cpu(in[i]) & 0x7f; if (c && !isprint(c)) c = '!';