Skip to content

Commit c45b6db

Browse files
committed
auth: limit long version strings to 63 characters and catch exceptions in secpoll
1 parent 88c1f21 commit c45b6db

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pdns/common_startup.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ void mainthread()
342342

343343
#ifndef WIN32
344344

345-
doSecPoll(true); // this must be BEFORE chroot
345+
try {
346+
doSecPoll(true); // this must be BEFORE chroot
347+
}
348+
catch(...) {}
346349

347350
if(!::arg()["chroot"].empty()) {
348351
if(::arg().mustDo("master") || ::arg().mustDo("slave"))

pdns/secpoll-auth.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ void doSecPoll(bool first)
125125
struct timeval now;
126126
gettimeofday(&now, 0);
127127

128-
string query = "auth-" + string(PACKAGEVERSION) +".security-status."+::arg()["security-poll-suffix"];
128+
string version = "auth-" + string(PACKAGEVERSION);
129+
string query = version.substr(0, 63) +".security-status."+::arg()["security-poll-suffix"];
129130

130131
if(*query.rbegin()!='.')
131132
query+='.';

0 commit comments

Comments
 (0)