From c412166de28e7f7722b42a4c4c5e637da2d570ee Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 4 Apr 2018 15:42:10 +0200 Subject: [PATCH] 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 --- include/efi_loader.h | 1 + 1 file changed, 1 insertion(+) 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) -- 2.25.1