From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGyeU-0005CO-OL for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:10:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGyeQ-00055Z-VN for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:10:22 -0400 Received: from [199.232.76.173] (port=54818 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGyeQ-00055B-Mr for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:10:18 -0400 Received: from mx2.redhat.com ([66.187.237.31]:35935) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGyeP-0007wy-Gh for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:10:18 -0400 From: Glauber Costa Date: Wed, 17 Jun 2009 13:09:50 -0400 Message-Id: <1245258604-2843-2-git-send-email-glommer@redhat.com> In-Reply-To: <1245258604-2843-1-git-send-email-glommer@redhat.com> References: <1245258604-2843-1-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 01/15] net: Fix -net socket, listen (Jan Kiszka) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka , aliguori@us.ibm.com From: aliguori In case no symbolic name is provided when requesting VLAN connection via listening TCP socket ('-net socket,listen=...'), qemu crashes. This fixes the cause. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7196 c046a42c-6fe2-441c-8c8c-71466251a162 Signed-off-by: Glauber Costa --- net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net.c b/net.c index ae54421..3938a02 100644 --- a/net.c +++ b/net.c @@ -1468,7 +1468,7 @@ static int net_socket_listen_init(VLANState *vlan, } s->vlan = vlan; s->model = strdup(model); - s->name = strdup(name); + s->name = name ? strdup(name) : NULL; s->fd = fd; qemu_set_fd_handler(fd, net_socket_accept, NULL, s); return 0; -- 1.6.2.2