[PR #743] [MERGED] Set value #1673

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

📋 Pull Request Information

Original PR: https://github.com/tzapu/WiFiManager/pull/743
Author: @dontsovcmc
Created: 9/24/2018
Status: Merged
Merged: 9/26/2018
Merged by: @tablatronix

Base: developmentHead: setValue


📝 Commits (2)

  • 85b2319 correct your idea about deflength
  • 7d42423 value limit is length

📊 Changes

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

View changed files

📝 WiFiManager.cpp (+3 -12)

📄 Description

Firstly, I correct your error:
if(_length < length){ to if(_length < deflength){
but it is dangerous to use strlen for default value cause overflow.
I remove you code to increate length.

Secondly,
a. memset
b. need not _value[_length] = '\0'; case already memset with length+1

  1. Now init() and getValue() are symmetrical for parameter length: you set and get with same limit.
  2. init() parameter is safe: you can use EEPROM buffer without null terminator.

🔄 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/743 **Author:** [@dontsovcmc](https://github.com/dontsovcmc) **Created:** 9/24/2018 **Status:** ✅ Merged **Merged:** 9/26/2018 **Merged by:** [@tablatronix](https://github.com/tablatronix) **Base:** `development` ← **Head:** `setValue` --- ### 📝 Commits (2) - [`85b2319`](https://github.com/tzapu/WiFiManager/commit/85b2319b593a69eb49a0e4c96aefb9a0cc812f02) correct your idea about deflength - [`7d42423`](https://github.com/tzapu/WiFiManager/commit/7d42423894e3006978d8f7d1ab1b2107a446190b) value limit is length ### 📊 Changes **1 file changed** (+3 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `WiFiManager.cpp` (+3 -12) </details> ### 📄 Description Firstly, I correct your error: `if(_length < length){` to `if(_length < deflength){` but it is dangerous to use strlen for default value cause overflow. I remove you code to increate length. Secondly, a. memset b. need not _value[_length] = '\0'; case already memset with length+1 1. Now init() and getValue() are symmetrical for parameter length: you set and get with same limit. 2. init() parameter is safe: you can use EEPROM buffer without null terminator. --- <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:36 +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#1673
No description provided.