From: Kees Monshouwer Date: Tue, 13 Jan 2015 12:12:54 +0000 (+0100) Subject: auth: limit long version strings to 63 characters and catch exceptions in secpoll X-Git-Tag: auth-3.4.2~14^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a64fd6af8493db34d65656999f5c73ceaedee1fc;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 c1abe1d26b..bef05b8dc5 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -430,7 +430,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 cfdce04d7d..50d9d4db74 100644 --- a/pdns/secpoll-auth.cc +++ b/pdns/secpoll-auth.cc @@ -122,7 +122,8 @@ void doSecPoll(bool first) struct timeval now; gettimeofday(&now, 0); - string query = "auth-" 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+='.'; @@ -149,7 +150,7 @@ void doSecPoll(bool first) } else { - L<