]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/vpc.c
block/vpc: Add a sanity check that fixed-size images have the right type
[mirror_qemu.git] / block / vpc.c
index 1b4c7333af0ed6714ee9e7cc87e52158ccbd37d9..297a26262ab1e58d6d42549decda77578319a73c 100644 (file)
@@ -276,7 +276,8 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
         if (ret < 0) {
             goto fail;
         }
-        if (strncmp(footer->creator, "conectix", 8)) {
+        if (strncmp(footer->creator, "conectix", 8) ||
+            be32_to_cpu(footer->type) != VHD_FIXED) {
             error_setg(errp, "invalid VPC image");
             ret = -EINVAL;
             goto fail;