Correctly handle NULL string for request arguments.

When iterating over arguments of a request, the value can be a null pointer
if the argument is provided without a `=`.
https://www.gnu.org/software/libmicrohttpd/manual/html_node/microhttpd_002drequests.html

We have to handle this correctly.

Should fix #116.
This commit is contained in:
Matthieu Gautier 2017-12-04 15:10:45 +00:00
parent 9a29874f9f
commit 9eaf512bf9

View File

@ -122,7 +122,7 @@ int RequestContext::fill_argument(void *__this, enum MHD_ValueKind kind,
const char *key, const char* value)
{
RequestContext *_this = static_cast<RequestContext*>(__this);
_this->arguments[key] = value;
_this->arguments[key] = value == nullptr ? "" : value;
return MHD_YES;
}