From aaefa2b07f0cc111815ed9ba5bb3fe798da57645 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 18 May 2017 18:17:24 +0200 Subject: [PATCH] wifi: fix check for PSK for new WPS credentials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/devices/wifi/nm-device-wifi.c:1855:20: error: logical ‘or’ of collectively exhaustive tests is always true [-Werror=logical-op] if (psk_len >= 8 || psk_len <= 63) { ^~ Fixes: 0eb76175047057fc466814632f25bfaf10566c37 --- src/devices/wifi/nm-device-wifi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index 79f8babc5d..a1f698bb33 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -1852,7 +1852,7 @@ supplicant_iface_wps_credentials_cb (NMSupplicantInterface *iface, val = g_variant_lookup_value (credentials, "Key", G_VARIANT_TYPE_BYTESTRING); if (val) { array = g_variant_get_fixed_array (val, &psk_len, 1); - if (psk_len >= 8 || psk_len <= 63) { + if (psk_len >= 8 && psk_len <= 63) { memcpy (psk, array, psk_len); psk[psk_len] = '\0'; secrets = g_variant_new_parsed ("[{%s, [{%s, <%s>}]}]",