From 74cef51bcb0bb9769fbe6a993fd59cda04b792e5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 13 Jul 2026 15:45:26 +0200 Subject: [PATCH] libmount: fix -Wunterminated-string-initialization warning The "xx\0" string literal is 4 bytes but buf is only 3, truncating the NUL terminator. Since the buffer is immediately overwritten by memcpy, just zero-initialize it instead. Signed-off-by: Karel Zak --- libmount/src/hook_veritydev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmount/src/hook_veritydev.c b/libmount/src/hook_veritydev.c index 92c89b0be..101b2209e 100644 --- a/libmount/src/hook_veritydev.c +++ b/libmount/src/hook_veritydev.c @@ -174,7 +174,7 @@ static void delete_veritydev(struct libmnt_context *cxt, /* Taken from https://gitlab.com/cryptsetup/cryptsetup/blob/master/lib/utils_crypt.c#L225 */ static size_t crypt_hex_to_bytes(const char *hex, char **result) { - char buf[3] = "xx\0", *endp, *bytes; + char buf[3] = { 0 }, *endp, *bytes; size_t i, len; len = strlen(hex); -- 2.47.3