From: Lennart Poettering Date: Tue, 2 Jul 2024 15:50:47 +0000 (+0200) Subject: efivars: use appropropriate uint8_t type when dealing with "raw" bytes X-Git-Tag: v257-rc1~994^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=70871dd0a3bde837acff6368e6da05c2b98df2c6;p=thirdparty%2Fsystemd.git efivars: use appropropriate uint8_t type when dealing with "raw" bytes We don't actually want chars here, but rather raw bytes, in particular to avoid signedness issues. Hence, let's use uint8_t here. --- diff --git a/src/boot/efi/efivars.c b/src/boot/efi/efivars.c index 500cba36ba6..b69e1706781 100644 --- a/src/boot/efi/efivars.c +++ b/src/boot/efi/efivars.c @@ -133,7 +133,7 @@ EFI_STATUS efivar_get_uint_string(const EFI_GUID *vendor, const char16_t *name, } EFI_STATUS efivar_get_uint32_le(const EFI_GUID *vendor, const char16_t *name, uint32_t *ret) { - _cleanup_free_ char *buf = NULL; + _cleanup_free_ uint8_t *buf = NULL; size_t size; EFI_STATUS err; @@ -155,7 +155,7 @@ EFI_STATUS efivar_get_uint32_le(const EFI_GUID *vendor, const char16_t *name, ui } EFI_STATUS efivar_get_uint64_le(const EFI_GUID *vendor, const char16_t *name, uint64_t *ret) { - _cleanup_free_ char *buf = NULL; + _cleanup_free_ uint8_t *buf = NULL; size_t size; EFI_STATUS err; @@ -202,7 +202,7 @@ EFI_STATUS efivar_get_raw(const EFI_GUID *vendor, const char16_t *name, void **r } EFI_STATUS efivar_get_boolean_u8(const EFI_GUID *vendor, const char16_t *name, bool *ret) { - _cleanup_free_ char *b = NULL; + _cleanup_free_ uint8_t *b = NULL; size_t size; EFI_STATUS err;