Skip to content

Commit

Permalink
Fix possible stack ovf issue #169 for ESP8266 due to too large printf…
Browse files Browse the repository at this point in the history
… buffer.
  • Loading branch information
mobizt committed Oct 30, 2024
1 parent a8c127c commit 7044413
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/mobizt/FirebaseClient/.github%2Fworkflows%2Fcompile_library.yml?logo=github&label=compile) [![Github Stars](https://img.shields.io/github/stars/mobizt/FirebaseClient?logo=github)](https://github.com/mobizt/FirebaseClient/stargazers) ![Github Issues](https://img.shields.io/github/issues/mobizt/FirebaseClient?logo=github)

![GitHub Release](https://img.shields.io/github/v/release/mobizt/FirebaseClient) ![Arduino](https://img.shields.io/badge/Arduino-v1.4.5-57C207?logo=arduino) ![PlatformIO](https://badges.registry.platformio.org/packages/mobizt/library/FirebaseClient.svg) ![GitHub Release Date](https://img.shields.io/github/release-date/mobizt/FirebaseClient)
![GitHub Release](https://img.shields.io/github/v/release/mobizt/FirebaseClient) ![Arduino](https://img.shields.io/badge/Arduino-v1.4.6-57C207?logo=arduino) ![PlatformIO](https://badges.registry.platformio.org/packages/mobizt/library/FirebaseClient.svg) ![GitHub Release Date](https://img.shields.io/github/release-date/mobizt/FirebaseClient)

[![GitHub Sponsors](https://img.shields.io/github/sponsors/mobizt?logo=github)](https://github.com/sponsors/mobizt)

Revision `2024-10-30T08:28:24Z`
Revision `2024-10-30T03:51:10Z`

## Table of Contents

Expand Down Expand Up @@ -3096,7 +3096,7 @@ FIREBASE_DISABLE_NATIVE_ETHERNET // For disabling native (sdk) Ethernet function
ENABLE_ASYNC_TCP_CLIENT // For Async TCP Client usage.
FIREBASE_ASYNC_QUEUE_LIMIT // For maximum async queue limit setting for an async client.
FIREBASE_PRINTF_PORT // For Firebase.printf debug port.
FIREBASE_PRINTF_BUFFER // Firebase.printf buffer size.
FIREBASE_PRINTF_BUFFER // Firebase.printf buffer size. The default printf buffer size is 1024 for ESP8266 and SAMD otherwise 4096. Some debug message may be truncated for larger text.
```

You can assign the optional build options using one of the following methods.
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": "FirebaseClient",
"version": "1.4.5",
"version": "1.4.6",
"keywords": "communication, REST, esp32, esp8266, arduino",
"description": "Async Firebase Client library for Arduino.",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=FirebaseClient

version=1.4.5
version=1.4.6

author=Mobizt

Expand Down
3 changes: 2 additions & 1 deletion src/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
* 🏷️ For Firebase.printf debug port.
* #define FIREBASE_PRINTF_PORT Serial
*
* * 🏷️ For Firebase.printf buffer size.
* * 🏷️ For Firebase.printf buffer size.
* The default printf buffer size is 1024 for ESP8266 and SAMD otherwise 4096.
* #define FIREBASE_PRINTF_BUFFER 2048
*/

Expand Down
6 changes: 5 additions & 1 deletion src/FirebaseClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,12 @@ namespace firebase
#if defined(FIREBASE_PRINTF_BUFFER)
int size = FIREBASE_PRINTF_BUFFER;
#else
// Default buffer size for large JSON response.
// Default buffer size for large JSON response.
#if defined(ARDUINO_ARCH_SAMD) || defined(ESP8266)
int size = 1024;
#else
int size = 4096;
#endif
#endif
char s[size];
va_list va;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#undef FIREBASE_CLIENT_VERSION
#endif

#define FIREBASE_CLIENT_VERSION "1.4.5"
#define FIREBASE_CLIENT_VERSION "1.4.6"

static void sys_idle()
{
Expand Down

0 comments on commit 7044413

Please sign in to comment.