Message ID | 1426145625-11320-1-git-send-email-arei.gonglei@huawei.com |
---|---|
State | New |
Headers | show |
On Do, 2015-03-12 at 15:33 +0800, arei.gonglei@huawei.com wrote: > From: Gonglei <arei.gonglei@huawei.com> > > Reproducer: > #./qemu-system-x86_64 -vnc :0,ip > qemu-system-x86_64: -vnc :1,ip: Invalid parameter 'ip' > Segmentation fault (core dumped) Added to vnc patch queue. thanks, Gerd
diff --git a/ui/vnc.c b/ui/vnc.c index 4b6ef1e..c5853d4 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3698,8 +3698,13 @@ QemuOpts *vnc_parse_func(const char *str) { QemuOptsList *olist = qemu_find_opts("vnc"); QemuOpts *opts = qemu_opts_parse(olist, str, 1); - const char *id = qemu_opts_id(opts); + const char *id; + if (!opts) { + return NULL; + } + + id = qemu_opts_id(opts); if (!id) { /* auto-assign id if not present */ vnc_auto_assign_id(olist, opts);