Skip to content

Commit 69386c7

Browse files
committed
Fix null pointer exception when connected() was called when basic client was not yet initialized.
1 parent 1951e59 commit 69386c7

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP_SSLClient",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"keywords": "communication, REST, esp32, esp8266, arduino",
55
"description": "This library provided the Secure Layer Networking (SSL/TLS) TCP Client for ESP8266, ESP32 and Raspberry Pi RP2040, Teensy, SAMD, AVR and other Arduino devices that support external networking interfaces e.g., WiFiClient, EthernetClient and GSMClient.",
66
"repository": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=ESP_SSLClient
22

3-
version=2.0.4
3+
version=2.0.5
44

55
author=Mobizt
66

src/ESP_SSLClient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
*
3-
* The ESP SSL Client Class, ESP_SSLClient.h v2.0.4
3+
* The ESP SSL Client Class, ESP_SSLClient.h v2.0.5
44
*
5-
* Created August 4, 2023
5+
* Created August 5, 2023
66
*
77
* The MIT License (MIT)
88
* Copyright (c) 2023 K. Suwatchai (Mobizt)

src/client/BSSL_SSL_Client.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* BSSL_SSL_Client library v1.0.2 for Arduino devices.
2+
* BSSL_SSL_Client library v1.0.3 for Arduino devices.
33
*
4-
* Created August 4, 2003
4+
* Created August 5, 2003
55
*
66
* This work contains codes based on WiFiClientSecure from Earle F. Philhower and SSLClient from OSU OPEnS Lab.
77
*
@@ -140,6 +140,9 @@ int BSSL_SSL_Client::connect(const char *host, uint16_t port)
140140

141141
uint8_t BSSL_SSL_Client::connected()
142142
{
143+
if (!_basic_client)
144+
return 0;
145+
143146
if (!_secure)
144147
return _basic_client->connected();
145148

src/client/BSSL_SSL_Client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* BSSL_SSL_Client library v1.0.2 for Arduino devices.
2+
* BSSL_SSL_Client library v1.0.3 for Arduino devices.
33
*
4-
* Created August 4, 2003
4+
* Created August 5, 2003
55
*
66
* This work contains codes based on WiFiClientSecure from Earle F. Philhower and SSLClient from OSU OPEnS Lab.
77
*

0 commit comments

Comments
 (0)