Skip to contentSkip to conversation

[7206] 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: 7206

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7206
Author:   aliguori
Date:     2009-04-21 20:47:55 +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:
--------------

    branches/stable_0_10/net.c

Modified: branches/stable_0_10/net.c
===================================================================

stable_0_10/net.c +1 -1
@@ -1468,7 +1468,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;