efi: as extra paranoia NUL terminate UTF-16 strings with three NUL bytes
authorLennart Poettering <lennart@poettering.net>
Wed, 27 May 2020 14:22:07 +0000 (16:22 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 27 Jul 2020 08:26:32 +0000 (10:26 +0200)
commit8906e88705040619b0ce0192a006c4fe5c728cbd
tree9a238e51e62440fb294dc6992429d7c941dbcc0f
parentc0599e47ce6a5cba65791b0c0785f1070ad3c8fd
efi: as extra paranoia NUL terminate UTF-16 strings with three NUL bytes

This is a safey net anyway, let's make it fully safe: if the data ends
on an uneven byte, then we need to complete the UTF-16 codepoint first,
before adding the final NUL byte pair. Hence let's suffix with three
NULs, instead of just two.

(cherry picked from commit c75e7da0b53dd67363b724502e91901e89097886)
src/basic/efivars.c