From patchwork Tue Oct 4 11:25:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 117603 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D0FC5B6F7E for ; Tue, 4 Oct 2011 22:28:27 +1100 (EST) Received: from localhost ([::1]:52875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB3Ad-0006RQ-Sp for incoming@patchwork.ozlabs.org; Tue, 04 Oct 2011 07:28:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB3AY-0006R5-Bx for qemu-devel@nongnu.org; Tue, 04 Oct 2011 07:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RB3AX-0002V8-7d for qemu-devel@nongnu.org; Tue, 04 Oct 2011 07:28:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB3AX-0002Um-0Z for qemu-devel@nongnu.org; Tue, 04 Oct 2011 07:28:17 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p94BSFLQ029230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 4 Oct 2011 07:28:15 -0400 Received: from bow.tlv.redhat.com (dhcp-3-73.tlv.redhat.com [10.35.3.73]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p94BSDBe010533; Tue, 4 Oct 2011 07:28:14 -0400 From: Alon Levy To: qemu-devel@nongnu.org Date: Tue, 4 Oct 2011 13:25:53 +0200 Message-Id: <1317727553-19852-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: kraxel@redhat.com Subject: [Qemu-devel] [PATCH] ui/spice-core: fix segfault in monitor 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 Fix segfault if a qxl device is present but no spice command line argument is given. RHBZ 743251. Signed-off-by: Alon Levy --- ui/spice-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 3cbc721..b14d1d9 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -413,7 +413,7 @@ void do_info_spice(Monitor *mon, QObject **ret_data) int port, tls_port; char version_string[20]; /* 12 = |255.255.255\0| is the max */ - if (!spice_server) { + if (!spice_server || !opts) { *ret_data = qobject_from_jsonf("{ 'enabled': false }"); return; }