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

Commit

Permalink
v1.6.1 to fix memory management bugs
Browse files Browse the repository at this point in the history
### 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)
  • Loading branch information
khoih-prog committed Mar 12, 2022
1 parent 969ddec commit 838e894
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 168 deletions.
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
Please ensure to specify the following:

* Arduino IDE version (e.g. 1.8.19) or Platform.io version
* 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.)
* 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.)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
Expand All @@ -28,7 +28,7 @@ Please ensure to specify the following:
```
Arduino IDE version: 1.8.19
RASPBERRY_PI_PICO board
ArduinoCore-mbed v2.7.2
ArduinoCore-mbed v2.8.0
OS: Ubuntu 20.04 LTS
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
Expand All @@ -51,3 +51,4 @@ There are usually some outstanding feature requests in the [existing issues list
### Sending Pull Requests

Pull Requests with changes and fixes are also welcome!

99 changes: 60 additions & 39 deletions README.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Release v1.6.1](#release-v161)
* [Release v1.6.0](#release-v160)
* [Release v1.5.2](#release-v152)
* [Release v1.5.1](#release-v151)
Expand All @@ -31,6 +32,13 @@

## Changelog

### Release v1.6.1

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)
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)

### Release v1.6.0

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)
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MySQL_MariaDB_Generic",
"version": "1.6.0",
"version": "1.6.1",
"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",
"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",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=MySQL_MariaDB_Generic
version=1.6.0
version=1.6.1
author=Dr. Charles Bell <chuck.bell@oracle.com>, Khoi Hoang <khoih.prog@gmail.com>
maintainer=Khoi Hoang <khoih.prog@gmail.com>
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.
Expand Down
12 changes: 4 additions & 8 deletions src/MySQL_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,20 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.6.0
Version: 1.6.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
...
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
**********************************************************************************************************************************/

#ifndef MYSQL_GENERIC_H
Expand Down
12 changes: 4 additions & 8 deletions src/MySQL_Generic_Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,20 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.6.0
Version: 1.6.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
...
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
**********************************************************************************************************************************/

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

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

if (server_version)
{
free(server_version); // don't need it anymore
free(server_version); // don't need it anymore
server_version = NULL;
}

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

if (server_version)
{
free(server_version); // don't need it anymore
free(server_version); // don't need it anymore
server_version = NULL;
}

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

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

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

#ifndef MYSQL_GENERIC_ENCRYPT_SHA1_IMPL_H
Expand Down
12 changes: 4 additions & 8 deletions src/MySQL_Generic_Ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,20 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.6.0
Version: 1.6.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
1.0.2 K Hoang 20/08/2020 Fix crashing bug when timeout. Make code more error-proof. Drop support to ESP8266_AT_Webserver.
1.0.3 K Hoang 02/10/2020 Add support to Ethernet ENC28J60 using new EthernetENC library.
1.1.0 K Hoang 08/06/2021 Add support to RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. etc.
1.2.0 K Hoang 20/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720A)
1.3.0 K Hoang 30/08/2021 Add support to Teensy 4.1 using NativeEthernet
1.3.1 K Hoang 31/08/2021 Remove unnecessary SPI-bus code in NativeEthernet examples
...
1.4.0 K Hoang 05/09/2021 Add support to Teensy 4.1 using QNEthernet
1.5.0 K Hoang 17/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.5.2 K Hoang 01/12/2021 Auto detect ESP32 core for LittleFS. Fix bug in examples for WT32_ETH01
1.6.0 K Hoang 10/03/2022 Fix memory leak bug. Optimize code.
1.6.1 K Hoang 12/03/2022 Fix memory management bug.
**********************************************************************************************************************************/

#ifndef MYSQL_GENERIC_ETHERNET_H
Expand Down

0 comments on commit 838e894

Please sign in to comment.