]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (verity) fix compiler warning
authorKarel Zak <kzak@redhat.com>
Mon, 26 May 2025 15:58:48 +0000 (17:58 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 26 May 2025 16:23:24 +0000 (18:23 +0200)
libmount/src/hook_veritydev.c: In function 'setup_veritydev':
libmount/src/hook_veritydev.c:457:13: warning: '%s' directive argument is null [-Wformat-overflow=]

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/hook_veritydev.c

index 12c63089714451a9dd4c082decb77c42eb42f768..0b5856844e1034b70878cfa2cb3b31bf0fe01ad4 100644 (file)
@@ -461,7 +461,7 @@ static int setup_veritydev( struct libmnt_context *cxt,
         * a lot of time and resources when there are duplicated mounts. If the roothash is the same, then the volumes
         * are also guaranteed to be identical. This is what systemd also does, so we can deduplicate across the whole
         * system. */
-       if (asprintf(&mapper_device, "%s-verity", root_hash) < 0)
+       if (!rc && asprintf(&mapper_device, "%s-verity", root_hash) < 0)
                rc = -ENOMEM;
 
        if (!rc)