The test program (and others, too) crashes when used in the following way: ./Test & curl http://localhost:8080?asdf Fast fix as I am not a C++ expert: ``` diff --git a/src/webserver.cpp b/src/webserver.cpp index 9858bff..a0ea97f 100644 --- a/src/webserver.cpp +++ b/src/webserver.cpp @@ -749,9 +749,16 @@ int webserver::build_request_args ( void *cls, enum MHD_ValueKind kind, const char *key, - const char *value + const char *orig_value ) { + int size; + char *value; + if (orig_value == NULL) + value = (char*) ""; + else + value = (char*) orig_value; + details::modded_request* mr = static_cast<details::modded_request*>(cls); { char buf[strlen(key) + strlen(value) + 3]; @@ -766,7 +773,11 @@ int webserver::build_request_args ( mr->dhr->querystring += string(buf); } } - int size = internal_unescaper((void*) mr->ws, (char*) value); + + if (orig_value == NULL) + size = 0; + else + size = internal_unescaper((void*) mr->ws, value); mr->dhr->set_arg(key, string(value, size)); return MHD_YES; } ```
Activity
etr commentedon Mar 4, 2014
Thank you for pointing it out.
It is solved in the current trunk head.
TASK-016 review: complete remaining minor cleanup pass
TASK-050: Tier 6 minor review cleanup (48 items)
TASK-055: sanitize default 500 body; opt-in expose_exception_messages