]> Git Repo - qemu.git/blobdiff - block/qcow2.c
block: Make essential BlockDriver objects public
[qemu.git] / block / qcow2.c
index d12049451a10de8b67001184c604f4e44a7e6203..cbc327b1b43a2790d8d5aaabb833acd3917aa206 100644 (file)
@@ -117,7 +117,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offset,
 #ifdef DEBUG_EXT
         printf("ext.magic = 0x%x\n", ext.magic);
 #endif
-        if (ext.len > end_offset - offset) {
+        if (offset > end_offset || ext.len > end_offset - offset) {
             error_setg(errp, "Header extension too large");
             return -EINVAL;
         }
@@ -2847,7 +2847,7 @@ static QemuOptsList qcow2_create_opts = {
     }
 };
 
-static BlockDriver bdrv_qcow2 = {
+BlockDriver bdrv_qcow2 = {
     .format_name        = "qcow2",
     .instance_size      = sizeof(BDRVQcowState),
     .bdrv_probe         = qcow2_probe,
This page took 0.020962 seconds and 4 git commands to generate.