From: Kees Monshouwer Date: Tue, 13 Jan 2015 11:54:27 +0000 (+0100) Subject: auth: limit long version strings to 63 characters and catch exceptions in secpoll X-Git-Tag: rec-3.7.0-rc1~6^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a02ba61202bde2a1d10ae98629951a2465eba5b;p=thirdparty%2Fpdns.git auth: limit long version strings to 63 characters and catch exceptions in secpoll --- diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index a1feccbaa2..189505b300 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -440,7 +440,10 @@ void mainthread() DNSPacket::s_udpTruncationThreshold = std::max(512, ::arg().asNum("udp-truncation-threshold")); DNSPacket::s_doEDNSSubnetProcessing = ::arg().mustDo("edns-subnet-processing"); - doSecPoll(true); // this must be BEFORE chroot + try { + doSecPoll(true); // this must be BEFORE chroot + } + catch(...) {} if(!::arg()["chroot"].empty()) { triggerLoadOfLibraries(); diff --git a/pdns/secpoll-auth.cc b/pdns/secpoll-auth.cc index 84b3a1a914..cf9cc8ff56 100644 --- a/pdns/secpoll-auth.cc +++ b/pdns/secpoll-auth.cc @@ -124,7 +124,8 @@ void doSecPoll(bool first) struct timeval now; gettimeofday(&now, 0); - string query = "auth-" + string(PACKAGEVERSION) +".security-status."+::arg()["security-poll-suffix"]; + string version = "auth-" + string(PACKAGEVERSION); + string query = version.substr(0, 63) +".security-status."+::arg()["security-poll-suffix"]; if(*query.rbegin()!='.') query+='.';