From: Heinrich Schuchardt Date: Wed, 4 Apr 2018 13:42:10 +0000 (+0200) Subject: efi_loader: ascii2unicode(): add trailing \0 X-Git-Tag: v2018.05-rc2~45^2~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c412166de28e7f7722b42a4c4c5e637da2d570ee;p=oweals%2Fu-boot.git efi_loader: ascii2unicode(): add trailing \0 When converting an ASCII string to UTF-16 don't forget to copy the trailing \0. Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- diff --git a/include/efi_loader.h b/include/efi_loader.h index 0df482ee21..21e6692e92 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -352,6 +352,7 @@ static inline void ascii2unicode(u16 *unicode, const char *ascii) { while (*ascii) *(unicode++) = *(ascii++); + *unicode = 0; } static inline int guidcmp(const efi_guid_t *g1, const efi_guid_t *g2)