]> git.proxmox.com Git - mirror_qemu.git/commit
net: avoid using variable length array in net_client_init()
authorStefano Garzarella <sgarzare@redhat.com>
Fri, 17 May 2019 13:47:46 +0000 (15:47 +0200)
committerJason Wang <jasowang@redhat.com>
Tue, 2 Jul 2019 02:21:06 +0000 (10:21 +0800)
commitc1112b2d3dfb2c4102f73eea8198c4fe9ff50883
tree4dcf655899e58f59b60ae034f8da6c8accd21923
parent21c520d0c1ab64770f09f6fbf5952807e856e903
net: avoid using variable length array in net_client_init()

net_client_init() uses a variable length array to store the prefix
of 'ipv6-net' parameter (e.g. if ipv6-net=fec0::0/64, the prefix
is 'fec0::0').
This patch introduces g_strsplit() to split the 'ipv6-net' parameter,
so we can remove the variable length array.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/net.c