]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2389] added more notes on length validation for from-str in::A ctor
authorJINMEI Tatuya <jinmei@isc.org>
Tue, 26 Feb 2013 21:19:02 +0000 (13:19 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Tue, 26 Feb 2013 21:19:02 +0000 (13:19 -0800)
src/lib/dns/rdata/in_1/a_1.cc

index c9ae65dd138805d315ebc48f04b5bc9850477fdf..b187346ebb2b843863f2b63d6ed7d12b7002788c 100644 (file)
@@ -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: '"