All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel]  [PATCH] net: Fix a potential segfault
@ 2018-06-11  5:53 Lin Ma
  2018-06-11  6:34 ` Thomas Huth
  0 siblings, 1 reply; 2+ messages in thread
From: Lin Ma @ 2018-06-11  5:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: jasowang, thuth, Lin Ma

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] net: Fix a potential segfault
  2018-06-11  5:53 [Qemu-devel] [PATCH] net: Fix a potential segfault Lin Ma
@ 2018-06-11  6:34 ` Thomas Huth
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2018-06-11  6:34 UTC (permalink / raw)
  To: Lin Ma, qemu-devel; +Cc: jasowang

On 11.06.2018 07:53, Lin Ma wrote:
> Signed-off-by: Lin Ma <lma@suse.com>
> ---
>  net/net.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Please provide a proper patch description: How can you provoke that
segfault? (i.e. a set of command line options)

 Thomas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-11  6:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11  5:53 [Qemu-devel] [PATCH] net: Fix a potential segfault Lin Ma
2018-06-11  6:34 ` Thomas Huth

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.