aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShijie Zhang <shijiez@qca.qualcomm.com>2013-04-26 12:30:01 +0300
committerThomas Wendt <thoemy@gmx.net>2013-09-24 20:09:35 +0200
commit4370c8280d5b226caf9ddcea17b674a704e9f5e1 (patch)
treeff2025dff0ecd9deaf3da42642959d9c7f4a8c7d
parent0dbdecc68d7d1f5c784216f26ffb712c912a2328 (diff)
downloadandroid_external_wpa_supplicant_8-4370c8280d5b226caf9ddcea17b674a704e9f5e1.tar.gz
android_external_wpa_supplicant_8-4370c8280d5b226caf9ddcea17b674a704e9f5e1.tar.bz2
android_external_wpa_supplicant_8-4370c8280d5b226caf9ddcea17b674a704e9f5e1.zip
EAP peer: Add check before calling getSessionId method
We should not call getSessionID method if it's not provided. This fixes a regression from commit 950c5630768285e460aa336c78a18162fb3e0434 where EAP methods that did not implement getSessionId resulted in NULL pointer dereference when deriving the key. Change-Id: Iff5a34c2251e1e3bd8d014a31465e187a4817551 Signed-off-by: Shijie Zhang <shijiez@qca.qualcomm.com>
-rw-r--r--src/eap_peer/eap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c
index 4df88539..c0d70786 100644
--- a/src/eap_peer/eap.c
+++ b/src/eap_peer/eap.c
@@ -406,9 +406,11 @@ SM_STATE(EAP, METHOD)
sm->eapKeyData = sm->m->getKey(sm, sm->eap_method_priv,
&sm->eapKeyDataLen);
os_free(sm->eapSessionId);
- sm->eapSessionId = sm->m->getSessionId(sm, sm->eap_method_priv,
- &sm->eapSessionIdLen);
- if (sm->eapSessionId) {
+ sm->eapSessionId = NULL;
+ if (sm->m->getSessionId) {
+ sm->eapSessionId = sm->m->getSessionId(
+ sm, sm->eap_method_priv,
+ &sm->eapSessionIdLen);
wpa_hexdump(MSG_DEBUG, "EAP: Session-Id",
sm->eapSessionId, sm->eapSessionIdLen);
}