1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-08 05:57:26 +03:00

Allow uneven length BootXXXX variables

The BootXXXX variables may have an uneven length. Don't return error
in this case.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
(cherry picked from commit 046f101bf6ecbe2c18fd969760256ada3e6230f0)
(cherry picked from commit 2e372afc358f50408580323c56a44a7a6284cce0)
This commit is contained in:
Goffredo Baroncelli 2022-08-22 21:25:45 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 5fe4b668cd
commit eb53ee4a2f

View File

@ -185,9 +185,6 @@ static ssize_t utf16_size(const uint16_t *s, size_t buf_len_bytes) {
/* Returns the size of the string in bytes without the terminating two zero bytes */
if (buf_len_bytes % sizeof(uint16_t) != 0)
return -EINVAL;
while (l < buf_len_bytes / sizeof(uint16_t)) {
if (s[l] == 0)
return (l + 1) * sizeof(uint16_t);