From: Lin Ma <lma@suse.com>
To: qemu-devel@nongnu.org
Cc: jasowang@redhat.com, thuth@redhat.com, Lin Ma <lma@suse.com>
Subject: [Qemu-devel] [PATCH] net: Fix a potential segfault
Date: Mon, 11 Jun 2018 13:53:52 +0800 [thread overview]
Message-ID: <20180611055352.8097-1-lma@suse.com> (raw)
Signed-off-by: Lin Ma <lma@suse.com>
---
net/net.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/net.c b/net/net.c
index efb9eaf779..f89790be4a 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1093,9 +1093,12 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
int ret = -1;
Visitor *v = opts_visitor_new(opts);
- if (is_netdev && is_help_option(qemu_opt_get(opts, "type"))) {
- show_netdevs();
- exit(0);
+ if (is_netdev) {
+ const char *type = qemu_opt_get(opts, "type");
+ if (type && is_help_option(type)) {
+ show_netdevs();
+ exit(0);
+ }
} else {
/* Parse convenience option format ip6-net=fec0::0[/64] */
const char *ip6_net = qemu_opt_get(opts, "ipv6-net");
--
2.16.2
next reply other threads:[~2018-06-11 5:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 5:53 Lin Ma [this message]
2018-06-11 6:34 ` [Qemu-devel] [PATCH] net: Fix a potential segfault Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180611055352.8097-1-lma@suse.com \
--to=lma@suse.com \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.