From 100cf78b3ddfffff1b6d4fbaa17b51deb2847cb3 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Sat, 2 Jan 2016 19:55:15 +0100 Subject: [PATCH] Fix uncaught DNSName build error in DLNotifyHandler --- pdns/dynhandler.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index e141c54856..7aff1d8cf0 100644 --- a/pdns/dynhandler.cc +++ b/pdns/dynhandler.cc @@ -270,9 +270,6 @@ string DLNotifyHostHandler(const vector&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&parts, Utility::pid_t ppid) { extern CommunicatorClass Communicator; @@ -301,6 +298,12 @@ string DLNotifyHandler(const vector&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"; -- 2.47.2