]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/efivars.c
efivars: make sure that _packed_ structure members are actually aligned as expected
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Feb 2019 16:05:56 +0000 (17:05 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Feb 2019 16:25:08 +0000 (17:25 +0100)
commitf7cb1c7900951c1c01b2cddb4462c35af2933114
tree604590fb3d9ec5ad5dfe260daf8b343dd2948e07
parentc92ab239a05392d0e899fa30b848644050e30b73
efivars: make sure that _packed_ structure members are actually aligned as expected

When looking for the terminating double-NUL, don't just read the memory
until the terminator is found, but use the information we got about the
buffer size.

The length parameter passed to utf16_to_utf8() would include the terminator, so
the converted string would end up with two terminators (the original one
converted to "utf8", still 0, and then the one that was always added anyway).
Instead let's pass just the length of the actual data to utf16_to_utf8().
src/shared/efivars.c