[U-Boot] [PATCH v3 2/5] efi_loader: ascii2unicode(): add trailing \0

Heinrich Schuchardt xypron.glpk at gmx.de
Wed Apr 4 13:42:10 UTC 2018


When converting an ASCII string to UTF-16 don't forget to copy the
trailing \0.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
v3
	new patch
---
 include/efi_loader.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index ee553c667f..4badb4b232 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -356,6 +356,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.16.3



More information about the U-Boot mailing list