Permalink
Browse files

auth: limit long version strings to 63 characters and catch exception…

…s in secpoll
  • Loading branch information...
1 parent 88c1f21 commit c45b6db84ed30fb33480a7a9ed90aa1676482bbd @mind04 mind04 committed with mind04 Jan 13, 2015
Showing with 6 additions and 2 deletions.
  1. +4 −1 pdns/common_startup.cc
  2. +2 −1 pdns/secpoll-auth.cc
@@ -342,7 +342,10 @@ void mainthread()
#ifndef WIN32
- doSecPoll(true); // this must be BEFORE chroot
+ try {
+ doSecPoll(true); // this must be BEFORE chroot
+ }
+ catch(...) {}
if(!::arg()["chroot"].empty()) {
if(::arg().mustDo("master") || ::arg().mustDo("slave"))
@@ -125,7 +125,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+='.';

0 comments on commit c45b6db

Please sign in to comment.