From: Charles-Henri Bruyand Date: Wed, 2 May 2018 14:18:50 +0000 (+0200) Subject: check if parameter has been submitted before accessing it X-Git-Tag: dnsdist-1.3.1~108^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6562%2Fhead;p=thirdparty%2Fpdns.git check if parameter has been submitted before accessing it --- diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index a9991dfefe..d3e357e76f 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -373,7 +373,7 @@ static void apiServerCacheFlush(HttpRequest* req, HttpResponse* resp) { throw HttpMethodNotAllowedException(); DNSName canon = apiNameToDNSName(req->getvars["domain"]); - bool subtree = (req->getvars["subtree"].compare("true") == 0); + bool subtree = (req->getvars.count("subtree") > 0 && req->getvars["subtree"].compare("true") == 0); int count = broadcastAccFunction(boost::bind(pleaseWipeCache, canon, subtree)); count += broadcastAccFunction(boost::bind(pleaseWipePacketCache, canon, subtree));