]> sourceware.org Git - lvm2.git/commitdiff
pvck: check result of dev_get_size
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 14 Nov 2019 16:32:22 +0000 (17:32 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 14 Nov 2019 17:06:42 +0000 (18:06 +0100)
Don't use garbage value for later computations.

tools/pvck.c

index c197a970164c652bfa15c3632842a0cd6a8a716a..c9692b010c4f47d31c49f65e3cdc810d48310c96 100644 (file)
@@ -1468,7 +1468,8 @@ static int _dump_search(struct cmd_context *cmd,
                uint64_t dev_bytes;
                uint64_t extra_bytes;
 
-               dev_get_size(dev, &dev_sectors);
+               if (!dev_get_size(dev, &dev_sectors))
+                       return_ECMD_FAILED;
 
                dev_bytes = dev_sectors * 512;
                extra_bytes = dev_bytes % ONE_MB_IN_BYTES;
This page took 0.034188 seconds and 5 git commands to generate.