From: Karel Zak Date: Mon, 13 Jul 2026 13:45:26 +0000 (+0200) Subject: libmount: fix -Wunterminated-string-initialization warning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74cef51bcb0bb9769fbe6a993fd59cda04b792e5;p=thirdparty%2Futil-linux.git 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 --- 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);