aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-11-10 15:01:26 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 19:22:34 (GMT)
commitc3081c9a5748680001fd4283a16ad6ecc95bb43c (patch)
tree3eca7e33e2bc60ea30807f4f91a2affb1f836561
parent075b73ea88bca80b90113bebbfeb70f67708401f (diff)
downloadhostap-06-c3081c9a5748680001fd4283a16ad6ecc95bb43c.zip
hostap-06-c3081c9a5748680001fd4283a16ad6ecc95bb43c.tar.gz
hostap-06-c3081c9a5748680001fd4283a16ad6ecc95bb43c.tar.bz2
WPS: Fix credential processing for open network case
There is no point in comparing cred->key == NULL since cred->key is an array (never NULL). key_len == 0 should be used instead to indicate that no key was specified. (cherry picked from commit e542b40f9384beb8b19d0a8017bfae2487c6798d)
-rw-r--r--hostapd/wps_hostapd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hostapd/wps_hostapd.c b/hostapd/wps_hostapd.c
index eaa7a33..656fe54 100644
--- a/hostapd/wps_hostapd.c
+++ b/hostapd/wps_hostapd.c
@@ -237,7 +237,7 @@ static int hostapd_wps_cred_cb(void *ctx, const struct wps_credential *cred)
hapd->wps->ssid_len = cred->ssid_len;
hapd->wps->encr_types = cred->encr_type;
hapd->wps->auth_types = cred->auth_type;
- if (cred->key == NULL) {
+ if (cred->key_len == 0) {
os_free(hapd->wps->network_key);
hapd->wps->network_key = NULL;
hapd->wps->network_key_len = 0;