Skip to contentSkip to conversation

[7196] net: Fix -net socket,listen (Jan Kiszka)

Qemu-devel Anthony Liguori 1 participant 1 message Apr 21, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 7196

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7196
Author:   aliguori
Date:     2009-04-21 19:56:11 +0000 (Tue, 21 Apr 2009)

Log Message:
-----------
net: Fix -net socket,listen (Jan Kiszka)

In case no symbolic name is provided when requesting VLAN connection via listening TCP socket ('-net socket,listen=...'), qemu crashes. This fixes the cause.

Modified Paths:
--------------
trunk/net.c

Modified: trunk/net.c
===================================================================

net.c +1 -1
@@ -1472,7 +1472,7 @@
     }
     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;