From: Kees Monshouwer Date: Mon, 9 Nov 2015 10:33:10 +0000 (+0100) Subject: comment nits X-Git-Tag: auth-4.0.0-rc1~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1106afd98b02dc379565f4fce227692f2e58b215;p=thirdparty%2Fpdns.git comment nits --- diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index 82bc2fe90e..8c885a895a 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -264,7 +264,7 @@ void DNSName::appendRawLabel(const char* start, unsigned int length) throw std::range_error("no such thing as an empty label to append"); if(length > 63) throw std::range_error("label too long to append"); - if(d_storage.size() + length > 254) // reserve two bytes, one for length and one for the root label + if(d_storage.size() + length > 254) // reserve one byte for the label length throw std::range_error("name too long to append"); if(d_storage.empty()) { @@ -283,7 +283,7 @@ void DNSName::prependRawLabel(const std::string& label) throw std::range_error("no such thing as an empty label to prepend"); if(label.size() > 63) throw std::range_error("label too long to prepend"); - if(d_storage.size() + label.size() > 254) // reserve two bytes, one for length and one for the root label + if(d_storage.size() + label.size() > 254) // reserve one byte for the label length throw std::range_error("name too long to prepend"); if(d_storage.empty()) diff --git a/pdns/dnsname.hh b/pdns/dnsname.hh index f2311655ab..be98100b8d 100644 --- a/pdns/dnsname.hh +++ b/pdns/dnsname.hh @@ -78,7 +78,7 @@ public: } DNSName& operator+=(const DNSName& rhs) { - if(d_storage.size() + rhs.d_storage.size() > 256) // reserve one byte for the root label + if(d_storage.size() + rhs.d_storage.size() > 256) // one extra byte for the second root label throw std::range_error("name too long"); if(rhs.empty()) return *this; diff --git a/pdns/opensslsigners.cc b/pdns/opensslsigners.cc index 3894cd7584..2381263ab9 100644 --- a/pdns/opensslsigners.cc +++ b/pdns/opensslsigners.cc @@ -12,6 +12,8 @@ #include "dnssecinfra.hh" +/* pthread locking */ + static pthread_mutex_t *openssllocks; extern "C" { diff --git a/pdns/opensslsigners.hh b/pdns/opensslsigners.hh index 5f474b6c93..f7337c4a6a 100644 --- a/pdns/opensslsigners.hh +++ b/pdns/opensslsigners.hh @@ -8,4 +8,6 @@ /* pthread locking */ void openssl_thread_setup(); void openssl_thread_cleanup(); + +/* seeding PRNG */ void openssl_seed();