Skip to content

Commit 803cf06

Browse files
committed
Merge branch 'bugfix/eap_client_crash' into 'master'
wpa_supplicant: Fix null pointer deference and memleak Closes IDFGH-3699 See merge request espressif/esp-idf!9690
2 parents 730db68 + 5502a55 commit 803cf06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/wpa_supplicant/src/crypto/tls_mbedtls.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ static void tls_set_ciphersuite(tls_context_t *tls)
384384
if (tls->ciphersuite[0]) {
385385
mbedtls_ssl_conf_ciphersuites(&tls->conf, tls->ciphersuite);
386386
} else if (mbedtls_pk_get_bitlen(&tls->clientkey) > 2048 ||
387-
mbedtls_pk_get_bitlen(&tls->cacert_ptr->pk) > 2048) {
387+
(tls->cacert_ptr && mbedtls_pk_get_bitlen(&tls->cacert_ptr->pk) > 2048)) {
388388
mbedtls_ssl_conf_ciphersuites(&tls->conf, eap_ciphersuite_preference);
389389
}
390390
}
@@ -504,6 +504,7 @@ void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn)
504504
{
505505
/* Free ssl ctx and data */
506506
tls_mbedtls_conn_delete((tls_context_t *) conn->tls);
507+
os_free(conn->tls);
507508
conn->tls = NULL;
508509
/* Data in in ssl ctx, free connection */
509510
os_free(conn);

0 commit comments

Comments
 (0)