]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: ascii2unicode(): add trailing \0
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 4 Apr 2018 13:42:10 +0000 (15:42 +0200)
committerAlexander Graf <agraf@suse.de>
Thu, 5 Apr 2018 08:01:38 +0000 (10:01 +0200)
When converting an ASCII string to UTF-16 don't forget to copy the
trailing \0.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
include/efi_loader.h

index 0df482ee217cdd6b36cfb3a81f237e501315c514..21e6692e92d97d11044d7102e3b6fdc728219c6b 100644 (file)
@@ -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)