]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
check if parameter has been submitted before accessing it 6562/head
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Wed, 2 May 2018 14:18:50 +0000 (16:18 +0200)
committerCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Wed, 2 May 2018 14:18:50 +0000 (16:18 +0200)
pdns/ws-recursor.cc

index a9991dfefeab21e73f9557f1b4a63092d1d38630..d3e357e76f685524db58e66acde801b254dcde4a 100644 (file)
@@ -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<uint64_t>(boost::bind(pleaseWipeCache, canon, subtree));
   count += broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, canon, subtree));