forked from me-no-dev/ESPAsyncWebServer
-
Notifications
You must be signed in to change notification settings - Fork 87
Labels
Type: BugSomething isn't workingSomething isn't working
Description
Platform
ESP32
IDE / Tooling
Arduino (IDE/CLI)
What happened?
Parsing of received HTTP POST parameters is incorrectly processed.
I found the error specifically in src/WebRequest.cpp where the followed macro is used.
#define __is_param_char(c) ((c) && ((c) != '{') && ((c) != '[') && ((c) != '&') && ((c) != '='))
This macro is fine, but the parameter inserted into the macro is used inappropriately in this case, because when this parameter is used in the macro 5 times, the variable i is always increased by +5 instead of +1.
This is where it's used incorrectly:
while (i < len && __is_param_char(((char *)buf)[i++]));
Correctly used, it should be like this
char ch; do {ch = ((char *)buf)[i];} while (i++ < len && __is_param_char(ch));
Stack Trace
POST parameters not found
Minimal Reproductible Example (MRE)
.
I confirm that:
- I have read the documentation.
- I have searched for similar discussions.
- I have searched for similar issues.
- I have looked at the examples.
- I have upgraded to the lasted version of ESPAsyncWebServer (and AsyncTCP for ESP32).
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't workingSomething isn't working