[gssdp/wip/libsoup3] client: Avoid critical if address is NULL



commit 955fac3978ed6edd10e1c2a7a90f20cc53bbd852
Author: Jens Georg <mail jensge org>
Date:   Wed Dec 29 17:04:54 2021 +0100

    client: Avoid critical if address is NULL

 libgssdp/gssdp-client.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index 5531d98..6a541dd 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -890,8 +890,9 @@ gssdp_client_get_host_ip (GSSDPClient *client)
         priv = gssdp_client_get_instance_private (client);
 
         if (priv->device.host_ip == NULL)
-                priv->device.host_ip = g_inet_address_to_string
-                                    (priv->device.host_addr);
+                if (priv->device.host_addr != NULL)
+                        priv->device.host_ip = g_inet_address_to_string
+                                            (priv->device.host_addr);
 
         return priv->device.host_ip;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]