From: Christian Hofstaedtler Date: Sat, 2 Jan 2016 18:55:15 +0000 (+0100) Subject: Fix uncaught DNSName build error in DLNotifyHandler X-Git-Tag: dnsdist-1.0.0-alpha2~101^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=100cf78b3ddfffff1b6d4fbaa17b51deb2847cb3;p=thirdparty%2Fpdns.git Fix uncaught DNSName build error in DLNotifyHandler --- 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";