Skip to content

Commit

Permalink
Clear cipher list on server creation, fix crash (#5171)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
earlephilhower authored Sep 26, 2018
1 parent d017157 commit 7c91eee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ WiFiClientSecure::~WiFiClientSecure() {
WiFiClientSecure::WiFiClientSecure(ClientContext* client,
const BearSSLX509List *chain, const BearSSLPrivateKey *sk,
int iobuf_in_size, int iobuf_out_size, const BearSSLX509List *client_CA_ta) {
_cipher_list = NULL;
_cipher_cnt = 0;
_clear();
_clearAuthenticationSettings();
_iobuf_in_size = iobuf_in_size;
Expand All @@ -133,6 +135,8 @@ WiFiClientSecure::WiFiClientSecure(ClientContext *client,
const BearSSLX509List *chain,
unsigned cert_issuer_key_type, const BearSSLPrivateKey *sk,
int iobuf_in_size, int iobuf_out_size, const BearSSLX509List *client_CA_ta) {
_cipher_list = NULL;
_cipher_cnt = 0;
_clear();
_clearAuthenticationSettings();
_iobuf_in_size = iobuf_in_size;
Expand Down

0 comments on commit 7c91eee

Please sign in to comment.