MXS-1220: Fix possible crash on NULL option value

When a request option without a value is given, microhttpd exposes this as
key with a NULL value.
This commit is contained in:
Markus Mäkelä
2017-05-24 16:35:52 +03:00
parent 607bdf3a1b
commit b6b108c8d5

View File

@ -35,7 +35,7 @@ static int value_iterator(void *cls,
{ {
std::pair<std::string, std::string>* cmp = (std::pair<std::string, std::string>*)cls; std::pair<std::string, std::string>* cmp = (std::pair<std::string, std::string>*)cls;
if (strcasecmp(cmp->first.c_str(), key) == 0) if (strcasecmp(cmp->first.c_str(), key) == 0 && value)
{ {
cmp->second = value; cmp->second = value;
return MHD_NO; return MHD_NO;