Browse Source

[5226] Addressed review comments

Francis Dupont 7 years ago
parent
commit
95e05cd2b1
2 changed files with 2 additions and 1 deletions
  1. 1 0
      src/lib/dhcp/option_custom.h
  2. 1 1
      src/lib/dhcp/tests/option_custom_unittest.cc

+ 1 - 0
src/lib/dhcp/option_custom.h

@@ -427,6 +427,7 @@ private:
     /// @param end iterator to end of input data.
     ///
     /// @return size of data to copy to the buffer.
+    /// @throw isc::OutOfRange if option buffer is truncated.
     size_t bufferLength(const OptionDataType data_type, bool in_array,
                         OptionBuffer::const_iterator begin,
                         OptionBuffer::const_iterator end) const;

+ 1 - 1
src/lib/dhcp/tests/option_custom_unittest.cc

@@ -1301,7 +1301,7 @@ TEST_F(OptionCustomTest, recordArrayData) {
     // Initialize field 0 to 8712.
     writeInt<uint16_t>(8712, buf);
     // Initialize field 1 to 'true'
-    buf.push_back(static_cast<unsigned short>(1));
+    writeInt<uint8_t>(1, buf);
     // Initialize field 2 to 'mydomain.example.com'.
     buf.insert(buf.end(), fqdn_data, fqdn_data + sizeof(fqdn_data));
     // Initialize field 3 to IPv4 address.