]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix uncaught DNSName build error in DLNotifyHostHandler 3151/head
authorChristian Hofstaedtler <christian.hofstaedtler@deduktiva.com>
Sat, 2 Jan 2016 18:55:35 +0000 (19:55 +0100)
committerChristian Hofstaedtler <christian.hofstaedtler@deduktiva.com>
Sat, 2 Jan 2016 19:21:19 +0000 (20:21 +0100)
pdns/dynhandler.cc

index 2a1ae34e6cadaaffd8742d4daf20534b1c52429e..1356b28ba6a8fb75c83e79833d837345fcdd60d0 100644 (file)
@@ -264,6 +264,13 @@ string DLNotifyHostHandler(const vector<string>&parts, Utility::pid_t ppid)
   if(!::arg().mustDo("master"))
       return "PowerDNS not configured as master";
 
+  DNSName domain;
+  try {
+    domain = DNSName(parts[1]);
+  } catch (...) {
+    return "Failed to parse domain as valid DNS name";
+  }
+
   try {
     ComboAddress ca(parts[2]);
   } catch(...)
@@ -271,8 +278,8 @@ string DLNotifyHostHandler(const vector<string>&parts, Utility::pid_t ppid)
     return "Unable to convert '"+parts[2]+"' to an IP address";
   }
   
-  L<<Logger::Warning<<"Notification request to host "<<parts[2]<<" for domain '"<<parts[1]<<"' received from operator"<<endl;
-  Communicator.notify(DNSName(parts[1]), parts[2]);
+  L<<Logger::Warning<<"Notification request to host "<<parts[2]<<" for domain '"<<domain<<"' received from operator"<<endl;
+  Communicator.notify(domain, parts[2]);
   return "Added to queue";
 }