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

index e141c54856b8041da094b10a92f74f11f4af5b58..7aff1d8cf07fd27456cdf1bf3fec2f6feae13417 100644 (file)
@@ -270,9 +270,6 @@ string DLNotifyHostHandler(const vector<string>&parts, Utility::pid_t ppid)
   return "Added to queue";
 }
 
-// XXX DNSName pain - if you pass us something that is not DNS,  you'll get an exception here, which you never got before
-// and I bet we don't report it well to the user...
-
 string DLNotifyHandler(const vector<string>&parts, Utility::pid_t ppid)
 {
   extern CommunicatorClass Communicator;
@@ -301,6 +298,12 @@ string DLNotifyHandler(const vector<string>&parts, Utility::pid_t ppid)
       return itoa(notified)+" out of "+itoa(total)+" zones added to queue - see log";
     return "Added "+itoa(total)+" MASTER zones to queue";
   } else {
+    DNSName domain;
+    try {
+      domain = DNSName(parts[1]);
+    } catch (...) {
+      return "Failed to parse domain as valid DNS name";
+    }
     if(!Communicator.notifyDomain(DNSName(parts[1])))
       return "Failed to add to the queue - see log";
     return "Added to queue";