Calls to stop before connected cause lockups. · Issue #13 · OPEnSLab-OSU/SSLClient (original) (raw)

Describe the bug
Calling sslClient.stop() when !sslClient.connected() causes buffer overflow, even after previously successful connection (and disconnect).

To Reproduce
EthernetClient mqttEthClient;
Ethernet.init(14);
SSLClient sslClient(mqttEthClient, TAs_HTTPS, (size_t)TAs_NUM_HTTPS, RANDOM_DATA_PIN);
sslClient.stop();

Expected behavior
Calls to stop should exit gracefully or ignore the request if already exited.

Context (please complete the following information):

Additional context
Discovered while trying to make the library robust to internet connectivity issues. Removing jump_handshake in br_ssl_engine_close prevents this (not a fix).