]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Allow uneven length BootXXXX variables
authorGoffredo Baroncelli <kreijack@inwind.it>
Mon, 22 Aug 2022 19:25:45 +0000 (21:25 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 23 Aug 2022 05:22:46 +0000 (07:22 +0200)
The BootXXXX variables may have an uneven length. Don't return error
in this case.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
src/shared/efi-api.c

index b9faae025b29bccd043db4c3b3860912bca4b4b6..f3f1091ad40f19826cd7a0d139f2125b15d148d4 100644 (file)
@@ -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);