From: Daniel Wagner <[email protected]>

The address of an array is never NULL, so the comparison will
always evaluate the same way. Instead test for the length
of the SSID.

Reported by coverity.
---
 gsupplicant/supplicant.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index eaea947..23ea41a 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -735,7 +735,7 @@ const void 
*g_supplicant_interface_get_wps_ssid(GSupplicantInterface *interface,
        if (!ssid_len)
                return NULL;
 
-       if (!interface || !interface->wps_cred.ssid) {
+       if (!interface || interface->wps_cred.ssid_len == 0) {
                *ssid_len = 0;
                return NULL;
        }
@@ -853,7 +853,7 @@ const char 
*g_supplicant_network_get_security(GSupplicantNetwork *network)
 const void *g_supplicant_network_get_ssid(GSupplicantNetwork *network,
                                                unsigned int *ssid_len)
 {
-       if (!network || !network->ssid) {
+       if (!network || network->ssid_len == 0) {
                *ssid_len = 0;
                return NULL;
        }
-- 
1.8.4.474.g128a96c

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to