]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-FAST peer: Fix error path handling for Session-Id
authorJouni Malinen <j@w1.fi>
Sat, 12 Dec 2015 09:12:32 +0000 (11:12 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 12 Dec 2015 09:12:32 +0000 (11:12 +0200)
It was possible to hit a NULL pointer dereference if Session-Id
derivation failed due to a memory allocation failure.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/eap_peer/eap_fast.c

index 833dcb6baa00f99585e1b6c0e081685b3594a404..6e8b12fd651130fc2931c5009ba8417e70e41b78 100644 (file)
@@ -1721,7 +1721,7 @@ static u8 * eap_fast_get_session_id(struct eap_sm *sm, void *priv, size_t *len)
        struct eap_fast_data *data = priv;
        u8 *id;
 
-       if (!data->success)
+       if (!data->success || !data->session_id)
                return NULL;
 
        id = os_malloc(data->id_len);