From: JINMEI Tatuya Date: Tue, 26 Feb 2013 21:19:02 +0000 (-0800) Subject: [2389] added more notes on length validation for from-str in::A ctor X-Git-Tag: bind10-1.1.0beta1-release~75^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=27dcc01ebedf492bdf7e281efe76223c7987c757;p=thirdparty%2Fkea.git [2389] added more notes on length validation for from-str in::A ctor --- diff --git a/src/lib/dns/rdata/in_1/a_1.cc b/src/lib/dns/rdata/in_1/a_1.cc index c9ae65dd13..b187346ebb 100644 --- a/src/lib/dns/rdata/in_1/a_1.cc +++ b/src/lib/dns/rdata/in_1/a_1.cc @@ -45,6 +45,10 @@ convertToIPv4Addr(const char* src, size_t src_len, uint32_t* dst) { // This check specifically rejects invalid input that begins with valid // address text followed by a nul character (and possibly followed by // further garbage). It cannot be detected by inet_pton(). + // + // Note that this is private subroutine of the in::A constructors, which + // pass std::string.size() or StringRegion::len as src_len, so it should + // be equal to strlen() unless there's an intermediate nul character. if (src_len != strlen(src)) { isc_throw(InvalidRdataText, "Bad IN/A RDATA text: unexpected nul in string: '"