]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TDLS: Fix TPK M1 error case (CID 68214)
authorJouni Malinen <j@w1.fi>
Mon, 16 Jun 2014 22:55:36 +0000 (01:55 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 16 Jun 2014 22:57:35 +0000 (01:57 +0300)
Commit 342bce63cdb375bc64ce1cbcdb9e6f48acdea1e3 introduced a possibility
of a NULL pointer dereference on the error path if a new peer entry
fails to get added (i.e., memory allocation failure). Fix that by
skipping the wpa_tdls_peer_free() call if necessary.

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

index 14139ba9e13daf00679039a3fbcc8b97ab0d2e09..59ed2c92d4418f4dda4a0e9320eb070083e1a4a3 100644 (file)
@@ -1920,7 +1920,8 @@ skip_rsn_check:
 error:
        wpa_tdls_send_error(sm, src_addr, WLAN_TDLS_SETUP_RESPONSE, dtoken,
                            status);
-       wpa_tdls_peer_free(sm, peer);
+       if (peer)
+               wpa_tdls_peer_free(sm, peer);
        return -1;
 }