From patchwork Wed Apr 29 16:37:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 466183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9A5B2140320 for ; Thu, 30 Apr 2015 02:39:53 +1000 (AEST) Received: from localhost ([::1]:40079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnV1b-00061o-JO for incoming@patchwork.ozlabs.org; Wed, 29 Apr 2015 12:39:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnUzs-0002QD-1G for qemu-devel@nongnu.org; Wed, 29 Apr 2015 12:38:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnUzo-0008JR-RO for qemu-devel@nongnu.org; Wed, 29 Apr 2015 12:38:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnUzo-0008JB-Kh for qemu-devel@nongnu.org; Wed, 29 Apr 2015 12:38:00 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3TGc0qk022406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 29 Apr 2015 12:38:00 -0400 Received: from colepc.redhat.com ([10.3.113.6]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3TGbwBQ014609; Wed, 29 Apr 2015 12:37:59 -0400 From: Cole Robinson To: qemu-devel@nongnu.org Date: Wed, 29 Apr 2015 12:37:48 -0400 Message-Id: <4321b926ed926ba64dc32f74c5f3b4ae9627f7ef.1430325445.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann , Cole Robinson Subject: [Qemu-devel] [PATCH 1/3] vnc: Don't assert if opening unix socket fails 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 Reproducer: $ qemu-system-x86_64 -display vnc=unix:/root/i-cant-access-you.sock qemu-system-x86_64: iohandler.c:60: qemu_set_fd_handler2: Assertion `fd >= 0' failed. Aborted (core dumped) Signed-off-by: Cole Robinson --- ui/vnc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/vnc.c b/ui/vnc.c index cffb5b7..f6b36e4 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3685,6 +3685,8 @@ void vnc_display_open(const char *id, Error **errp) /* listen for connects */ if (strncmp(vnc, "unix:", 5) == 0) { vs->lsock = unix_listen(vnc+5, NULL, 0, errp); + if (vs->lsock < 0) + goto fail; vs->is_unix = true; } else { vs->lsock = inet_listen_opts(sopts, 5900, errp);