diff options
author | Jouni Malinen <j@w1.fi> | 2010-09-04 21:37:36 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2010-09-04 21:37:36 +0300 |
commit | cce1f698e58843d67f598b6a7161756d546e5b66 (patch) | |
tree | f3f8bc121c3a7a8fcd19030f9461352048a53a31 /src/eap_server | |
parent | a745b7a775d449222f17bd338bab4802e05435c0 (diff) | |
download | external_wpa_supplicant_8_ti-cce1f698e58843d67f598b6a7161756d546e5b66.zip external_wpa_supplicant_8_ti-cce1f698e58843d67f598b6a7161756d546e5b66.tar.gz external_wpa_supplicant_8_ti-cce1f698e58843d67f598b6a7161756d546e5b66.tar.bz2 |
WPS: Use more defensive design to avoid theoretical NULL deref
Prior to commit 6195adda9b4306cda2b06b930c59c95832d026a9 the sm->user
dereference did not exist here. While this is in practice non-NULL,
better use more defensive construction here to avoid NULL pointer
dereference should this ever change.
Diffstat (limited to 'src/eap_server')
-rw-r--r-- | src/eap_server/eap_server_wsc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/eap_server/eap_server_wsc.c b/src/eap_server/eap_server_wsc.c index 28d4f67..e6d32f2 100644 --- a/src/eap_server/eap_server_wsc.c +++ b/src/eap_server/eap_server_wsc.c @@ -128,9 +128,10 @@ static void * eap_wsc_init(struct eap_sm *sm) wpa_printf(MSG_DEBUG, "EAP-WSC: No AP PIN (password) " "configured for Enrollee functionality - " "allow for probing capabilities (M1)"); + } else { + cfg.pin = sm->user->password; + cfg.pin_len = sm->user->password_len; } - cfg.pin = sm->user->password; - cfg.pin_len = sm->user->password_len; } cfg.assoc_wps_ie = sm->assoc_wps_ie; cfg.peer_addr = sm->peer_addr; |