Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 838e894

Browse files
authored
v1.6.1 to fix memory management bugs
### Release v1.6.1 1. Fix memory management bugs. Check [corrupt heap at MySQL_Connection destructor #19](#19) and [malloc server_version result not correctly handled may lead to memory corruption #20](#20) 2. Add support to SAMD21/SAMD51 boards using [Fab_SAM_Arduino core](https://github.com/qbolsee/ArduinoCore-fab-sam) 3. Add support to RP2040 boards using `Seeed RP2040 core` 4. Add `Packages' Patches` for [Fab_SAM_Arduino core](https://github.com/qbolsee/ArduinoCore-fab-sam)
1 parent 969ddec commit 838e894

18 files changed

+147
-168
lines changed

CONTRIBUTING.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
18-
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP32 core v2.0.2, ESP8266 core v3.0.2, ArduinoCore-mbed v2.7.2, etc.)
18+
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP32 core v2.0.2, ESP8266 core v3.0.2, ArduinoCore-mbed v2.8.0, etc.)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -28,7 +28,7 @@ Please ensure to specify the following:
2828
```
2929
Arduino IDE version: 1.8.19
3030
RASPBERRY_PI_PICO board
31-
ArduinoCore-mbed v2.7.2
31+
ArduinoCore-mbed v2.8.0
3232
OS: Ubuntu 20.04 LTS
3333
Linux xy-Inspiron-3593 5.13.0-35-generic #40~20.04.1-Ubuntu SMP Mon Mar 7 09:18:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3434
@@ -51,3 +51,4 @@ There are usually some outstanding feature requests in the [existing issues list
5151
### Sending Pull Requests
5252

5353
Pull Requests with changes and fixes are also welcome!
54+

README.md

+60-39
Large diffs are not rendered by default.

changelog.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Release v1.6.1](#release-v161)
1516
* [Release v1.6.0](#release-v160)
1617
* [Release v1.5.2](#release-v152)
1718
* [Release v1.5.1](#release-v151)
@@ -31,6 +32,13 @@
3132

3233
## Changelog
3334

35+
### Release v1.6.1
36+
37+
1. Fix memory management bugs. Check [corrupt heap at MySQL_Connection destructor #19](https://github.com/khoih-prog/MySQL_MariaDB_Generic/issues/19) and [malloc server_version result not correctly handled may lead to memory corruption #20](https://github.com/khoih-prog/MySQL_MariaDB_Generic/issues/20)
38+
2. Add support to SAMD21/SAMD51 boards using [Fab_SAM_Arduino core](https://github.com/qbolsee/ArduinoCore-fab-sam)
39+
3. Add support to RP2040 boards using `Seeed RP2040 core`
40+
4. Add `Packages' Patches` for [Fab_SAM_Arduino core](https://github.com/qbolsee/ArduinoCore-fab-sam)
41+
3442
### Release v1.6.0
3543

3644
1. Fix memory leak bugs. Check [memory leak on 'server_version' #17](https://github.com/khoih-prog/MySQL_MariaDB_Generic/issues/17) and [memory leak on MySQL_Connection.MySQL_Packet.buffer #18](https://github.com/khoih-prog/MySQL_MariaDB_Generic/issues/18)

library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "MySQL_MariaDB_Generic",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"keywords": "Communication, Database, Storage, MySQL, MariaDB, wt32-eth01, Teensy, SAMD, nRF52, W5x00, Ethernet, wifi, wifinina, lan8720, rp2040, nano-33-iot, nano-rp2040-connect, QNEthernet, native-ethernet, Portenta-H7, SAM DUE, ENC28J60, rpi-pico, Arduino, AVR",
55
"description": "Connects to MySQL or MariaDB using ESP8266/ESP32, WT32_ETH01 (ESP32 + LAN8720A), nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, Teensy, SAM DUE, Mega, RP2040-based boards, Portenta_H7, etc. with W5x00, ENC28J60 Ethernet, Teensy 4.1 NativeEthernet/QNEthernet, WiFiNINA modules/shields or Portenta_H7 WiFi/Ethernet. W5x00 can use Ethernet, EthernetLarge, Ethernet2 or Ethernet3 library. ENC28J60 can use either EthernetENC or UIPEthernet Library. Now accepting server's hostname, besides IPAddress",
66
"authors": [

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=MySQL_MariaDB_Generic
2-
version=1.6.0
2+
version=1.6.1
33
author=Dr. Charles Bell <chuck.bell@oracle.com>, Khoi Hoang <khoih.prog@gmail.com>
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
55
sentence=Connects to MySQL or MariaDB using ESP8266/ESP32, WT32_ETH01 (ESP32 + LAN8720A), nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, Teensy, SAM DUE, Mega, RP2040-based boards, Portenta_H7, etc. with W5x00, ENC28J60 Ethernet, Teensy 4.1 NativeEthernet/QNEthernet, WiFiNINA modules/shields or Portenta_H7 WiFi/Ethernet. W5x00 can use Ethernet, EthernetLarge, Ethernet2 or Ethernet3 library. ENC28J60 can use either EthernetENC or UIPEthernet Library.

src/MySQL_Generic.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,20 @@
1111
1212
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1313
Licensed under MIT license
14-
Version: 1.6.0
14+
15+
Version: 1.6.1
1516
1617
Version Modified By Date Comments
1718
------- ----------- ---------- -----------
1819
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
1920
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
20-
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
21-
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
22-
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
23-
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
24-
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
25-
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
26-
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
21+
...
2722
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
2823
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2924
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3025
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
3126
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
27+
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
3228
**********************************************************************************************************************************/
3329

3430
#ifndef MYSQL_GENERIC_H

src/MySQL_Generic_Connection.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,20 @@
1111
1212
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1313
Licensed under MIT license
14-
Version: 1.6.0
14+
15+
Version: 1.6.1
1516
1617
Version Modified By Date Comments
1718
------- ----------- ---------- -----------
1819
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
1920
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
20-
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
21-
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
22-
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
23-
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
24-
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
25-
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
26-
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
21+
...
2722
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
2823
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2924
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3025
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
3126
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
27+
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
3228
**********************************************************************************************************************************/
3329

3430
/*********************************************************************************************************************************

src/MySQL_Generic_Connection_Impl.h

+6-10
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,20 @@
1111
1212
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1313
Licensed under MIT license
14-
Version: 1.6.0
14+
15+
Version: 1.6.1
1516
1617
Version Modified By Date Comments
1718
------- ----------- ---------- -----------
1819
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
1920
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
20-
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
21-
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
22-
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
23-
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
24-
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
25-
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
26-
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
21+
...
2722
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
2823
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2924
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3025
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
3126
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
27+
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
3228
**********************************************************************************************************************************/
3329

3430
/*********************************************************************************************************************************
@@ -154,7 +150,7 @@ bool MySQL_Connection::connect(const char *hostname, const uint16_t& port, char
154150

155151
if (server_version)
156152
{
157-
free(server_version); // don't need it anymore
153+
free(server_version); // don't need it anymore
158154
server_version = NULL;
159155
}
160156

@@ -240,7 +236,7 @@ Connection_Result MySQL_Connection::connectNonBlocking(const char *hostname, con
240236

241237
if (server_version)
242238
{
243-
free(server_version); // don't need it anymore
239+
free(server_version); // don't need it anymore
244240
server_version = NULL;
245241
}
246242

src/MySQL_Generic_Debug.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,20 @@
1111
1212
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1313
Licensed under MIT license
14-
Version: 1.6.0
14+
15+
Version: 1.6.1
1516
1617
Version Modified By Date Comments
1718
------- ----------- ---------- -----------
1819
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
1920
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
20-
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
21-
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
22-
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
23-
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
24-
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
25-
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
26-
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
21+
...
2722
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
2823
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2924
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3025
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
3126
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
27+
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
3228
**********************************************************************************************************************************/
3329

3430
/*********************************************************************************************************************************

src/MySQL_Generic_Encrypt_Sha1.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,20 @@
1616
1717
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1818
Licensed under MIT license
19-
Version: 1.6.0
19+
20+
Version: 1.6.1
2021
2122
Version Modified By Date Comments
2223
------- ----------- ---------- -----------
2324
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
2425
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
25-
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
26-
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
27-
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
28-
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
29-
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
30-
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
31-
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
26+
...
3227
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
3328
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
3429
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3530
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
3631
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
32+
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
3733
**********************************************************************************************************************************/
3834

3935
#ifndef MYSQL_GENERIC_ENCRYPT_SHA1_H

src/MySQL_Generic_Encrypt_Sha1_Impl.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,20 @@
1616
1717
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1818
Licensed under MIT license
19-
Version: 1.6.0
19+
20+
Version: 1.6.1
2021
2122
Version Modified By Date Comments
2223
------- ----------- ---------- -----------
2324
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
2425
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
25-
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
26-
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
27-
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
28-
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
29-
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
30-
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
31-
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
26+
...
3227
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
3328
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
3429
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3530
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
3631
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
32+
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
3733
**********************************************************************************************************************************/
3834

3935
#ifndef MYSQL_GENERIC_ENCRYPT_SHA1_IMPL_H

src/MySQL_Generic_Ethernet.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,20 @@
1111
1212
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1313
Licensed under MIT license
14-
Version: 1.6.0
14+
15+
Version: 1.6.1
1516
1617
Version Modified By Date Comments
1718
------- ----------- ---------- -----------
1819
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
1920
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
20-
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
21-
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
22-
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
23-
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
24-
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
25-
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
26-
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
21+
...
2722
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
2823
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2924
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
3025
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
3126
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
27+
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
3228
**********************************************************************************************************************************/
3329

3430
#ifndef MYSQL_GENERIC_ETHERNET_H

0 commit comments

Comments
 (0)