Explorar el Código

Merge branch 'bugfix/eap_client_crash_4.1' into 'release/v4.1'

wpa_supplicant: Fix null pointer dereference if eap init failed

See merge request espressif/esp-idf!11642
Jiang Jiang Jian hace 5 años
padre
commit
73f601554b
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      components/wpa_supplicant/src/crypto/tls_mbedtls.c

+ 4 - 0
components/wpa_supplicant/src/crypto/tls_mbedtls.c

@@ -502,6 +502,10 @@ struct tls_connection * tls_connection_init(void *tls_ctx)
 
 void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn)
 {
+	/* tls init failed case */
+	if (!conn) {
+		return;
+	}
 	/* Free ssl ctx and data */
 	tls_mbedtls_conn_delete((tls_context_t *) conn->tls);
 	os_free(conn->tls);