]> git.ipfire.org Git - thirdparty/grub.git/commit
loader/efi/linux: Do not pass excessive size for source string
authorFrediano Ziglio <frediano.ziglio@cloud.com>
Wed, 25 Jun 2025 13:42:40 +0000 (14:42 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 26 Jun 2025 16:05:08 +0000 (18:05 +0200)
commitde4e8e2aa6d181096193edd137aa07608f746d24
tree8d4a0771a8c0b09da1920fa427661759992f78b2
parent8c8f966643f1812246ec044389e07d481c87983c
loader/efi/linux: Do not pass excessive size for source string

The size passed to grub_utf8_to_utf16() for the source string is
used as a limit for the string if NUL character is not encountered.
However, len, which is "strlen(src) * 2 + 2" is surely greater than
strlen(src). Pass the exact correct length.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/efi/linux.c