forked from me-no-dev/ESPAsyncWebServer
-
-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
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));
Metadata
Metadata
Assignees
Labels
No labels