From: Goffredo Baroncelli Date: Mon, 22 Aug 2022 19:25:45 +0000 (+0200) Subject: Allow uneven length BootXXXX variables X-Git-Tag: v252-rc1~373 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=046f101bf6ecbe2c18fd969760256ada3e6230f0;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/shared/efi-api.c b/src/shared/efi-api.c index b9faae025b2..f3f1091ad40 100644 --- a/src/shared/efi-api.c +++ b/src/shared/efi-api.c @@ -180,9 +180,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);