aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-09-04 18:37:36 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-05 14:35:45 (GMT)
commita0d6004d3392ec54a88334cee097af08e62c5167 (patch)
tree7e57452143c01d8e7bc1b409257adf50a4682a07
parent11ea6f7dd1ea7a553ecfdc6cf34fd71ea06ededb (diff)
downloadhostap-07-a0d6004d3392ec54a88334cee097af08e62c5167.zip
hostap-07-a0d6004d3392ec54a88334cee097af08e62c5167.tar.gz
hostap-07-a0d6004d3392ec54a88334cee097af08e62c5167.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. (cherry picked from commit cce1f698e58843d67f598b6a7161756d546e5b66)
-rw-r--r--src/eap_server/eap_server_wsc.c5
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 846c382..77cf9e2 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;