From patchwork Tue Mar 19 09:35:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 228979 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4A0E92C00BF for ; Tue, 19 Mar 2013 20:36:07 +1100 (EST) Received: from localhost ([::1]:38384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHsxh-0002je-Ha for incoming@patchwork.ozlabs.org; Tue, 19 Mar 2013 05:36:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHsxJ-0002jV-DP for qemu-devel@nongnu.org; Tue, 19 Mar 2013 05:35:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHsxE-0003Oj-NQ for qemu-devel@nongnu.org; Tue, 19 Mar 2013 05:35:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHsxE-0003Ob-GN for qemu-devel@nongnu.org; Tue, 19 Mar 2013 05:35:36 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2J9ZZ3f021279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 19 Mar 2013 05:35:35 -0400 Received: from localhost.localdomain (vpn1-7-157.ams2.redhat.com [10.36.7.157]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2J9ZXpU014062; Tue, 19 Mar 2013 05:35:34 -0400 From: Alon Levy To: qemu-devel@nongnu.org Date: Tue, 19 Mar 2013 11:35:32 +0200 Message-Id: <1363685732-20827-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH] qcow2: fix null deref apparent during migration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Alon Levy --- block/qcow2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);