diff mbox

qcow2: fix null deref apparent during migration

Message ID 1363685732-20827-1-git-send-email-alevy@redhat.com
State New
Headers show

Commit Message

Alon Levy March 19, 2013, 9:35 a.m. UTC
Signed-off-by: Alon Levy <alevy@redhat.com>
---
 block/qcow2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Kevin Wolf March 19, 2013, 10:25 a.m. UTC | #1
Am 19.03.2013 um 10:35 hat Alon Levy geschrieben:
> Signed-off-by: Alon Levy <alevy@redhat.com>
> ---
>  block/qcow2.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Thanks, Alon. I already sent a more comprehensive patch yesterday:
http://patchwork.ozlabs.org/patch/228462/

I guess I should send a pull request for it quickly.

Kevin
diff mbox

Patch

diff --git a/block/qcow2.c b/block/qcow2.c
index 1f99866..260a1d3 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -512,7 +512,9 @@  static int qcow2_open(BlockDriverState *bs, QDict *options, int flags)
 
     /* Enable lazy_refcounts according to image and command line options */
     opts = qemu_opts_create_nofail(&qcow2_runtime_opts);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
+    if (options) {
+        qemu_opts_absorb_qdict(opts, options, &local_err);
+    }
     if (error_is_set(&local_err)) {
         qerror_report_err(local_err);
         error_free(local_err);