Skip to content

Commit 7c91eee

Browse files
Clear cipher list on server creation, fix crash (#5171)
The cipher list values were not initialized to NULL appropriately for the BearSSL::WiFiClientSecure() constructor called by the Server object. This caused a crash as a random value was free'd when conecting to the SSL server object.
1 parent d017157 commit 7c91eee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ WiFiClientSecure::~WiFiClientSecure() {
116116
WiFiClientSecure::WiFiClientSecure(ClientContext* client,
117117
const BearSSLX509List *chain, const BearSSLPrivateKey *sk,
118118
int iobuf_in_size, int iobuf_out_size, const BearSSLX509List *client_CA_ta) {
119+
_cipher_list = NULL;
120+
_cipher_cnt = 0;
119121
_clear();
120122
_clearAuthenticationSettings();
121123
_iobuf_in_size = iobuf_in_size;
@@ -133,6 +135,8 @@ WiFiClientSecure::WiFiClientSecure(ClientContext *client,
133135
const BearSSLX509List *chain,
134136
unsigned cert_issuer_key_type, const BearSSLPrivateKey *sk,
135137
int iobuf_in_size, int iobuf_out_size, const BearSSLX509List *client_CA_ta) {
138+
_cipher_list = NULL;
139+
_cipher_cnt = 0;
136140
_clear();
137141
_clearAuthenticationSettings();
138142
_iobuf_in_size = iobuf_in_size;

0 commit comments

Comments
 (0)