[PR #660] [MERGED] Fix crasahes in doParamSave() & WiFiManagerParameter::setValue #1658

Closed
opened 2026-02-28 02:12:33 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/tzapu/WiFiManager/pull/660
Author: @liebman
Created: 7/15/2018
Status: Merged
Merged: 7/16/2018
Merged by: @tablatronix

Base: developmentHead: do_param_save


📝 Commits (2)

  • 85dd747 Use hasParam() instead of checking server.arg() for NULL, it returns a String anyway.
  • 2fac07c WiFiManagerParameter::setValue used length of default value for i

📊 Changes

1 file changed (+12 additions, -6 deletions)

View changed files

📝 WiFiManager.cpp (+12 -6)

📄 Description

Had crashes in doParamSave().

Changed to use server.hasParam() instead of checking server.arg() for NULL, it returns a String not a pointer.

Don't use .c_str() when its being assigned to a String. I think using .c_str() on String that are transient is probably not safe.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/tzapu/WiFiManager/pull/660 **Author:** [@liebman](https://github.com/liebman) **Created:** 7/15/2018 **Status:** ✅ Merged **Merged:** 7/16/2018 **Merged by:** [@tablatronix](https://github.com/tablatronix) **Base:** `development` ← **Head:** `do_param_save` --- ### 📝 Commits (2) - [`85dd747`](https://github.com/tzapu/WiFiManager/commit/85dd747949f302c022330dbd509107237fed7ecd) Use hasParam() instead of checking server.arg() for NULL, it returns a String anyway. - [`2fac07c`](https://github.com/tzapu/WiFiManager/commit/2fac07cbf0228d49a479fa2811bf97591a2d532d) WiFiManagerParameter::setValue used length of default value for i ### 📊 Changes **1 file changed** (+12 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `WiFiManager.cpp` (+12 -6) </details> ### 📄 Description Had crashes in `doParamSave()`. Changed to use `server.hasParam()` instead of checking `server.arg()` for NULL, it returns a `String` not a pointer. Don't use `.c_str()` when its being assigned to a `String`. I think using `.c_str()` on `String` that are transient is probably not safe. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 02:12:33 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1658
No description provided.