mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1504] _length member variable in WiFiManagerParameter object not initialized #1284
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1284
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hocky101 on GitHub (Sep 21, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1504
Basic Infos
Generic ESP32 DevKit Module
Hardware
WiFimanager Branch/Release: Master
version=2.0.13-beta
Esp8266/Esp32:
Generic ESP32 DevKit Module
Hardware: ESP32-WROOM-32
Core Version: 2.0.5
Description
_lengthmember variable inWiFiManagerParameterobject not initialized.Problem description
With the following code:
the constructor of WiFiManagerParameter() doesn't initialize the _length member variable.
If it happened that the
lengthparameter to theWiFiManagerParameterconstructor is the same as_lengthmember variable, then insetValue(), memory for_valuewould not be allocated, resulting in panic in the ensuing code.In 2.0.12-beta, there is no comparison between
_lengthmember variable andlengthparameter, and_valueis always allocated memory, which is why it doesn't crash in 2.0.12-beta.@tablatronix commented on GitHub (Sep 21, 2022):
hmm i thought I fixed that already, odd
@tablatronix commented on GitHub (Sep 21, 2022):
I cant get it to blow up at all, got an example or is this hypothetical?
Also are you getting a compiler warning, I would have expected one... hmm
@tablatronix commented on GitHub (Sep 21, 2022):
i cant think of a way to reliable unit test this oh well, I dont think will be a major issue needing a patch
@hocky101 commented on GitHub (Sep 22, 2022):
It is not hypothetical. I found it on my existing projects. I didn't include the code as it is a large sketch consisting of multiple files & libraries.
Following is an example code to reproduce the issue.
And the debug output with changes in
WiFiManagerParameter::init()to print out thelength&_lengthvalues.It panic'd on the 2nd
WiFiManagerParameterinitialization:Hope this help.
With your latest changes
_length = 1inWiFiManager.cpp, the bug is fixed. Thanks.@hansimglueck commented on GitHub (Nov 23, 2022):
Hi. Even though I dont really get what this is about, I found that when I have a length = 1 this leads to kernel panic now...
WiFiManagerParameter modeParam("mode", "Mode - 0: normal, 1: special", "0", 1);At least after reading this thread I just changed the length to 2 and its working again...