]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2786] Always validate the contents of the buffer when provided.
authorMarcin Siodelski <marcin@isc.org>
Thu, 16 May 2013 08:28:19 +0000 (10:28 +0200)
committerMarcin Siodelski <marcin@isc.org>
Thu, 16 May 2013 08:28:19 +0000 (10:28 +0200)
src/lib/dhcp/option_custom.cc

index e807928da1eb10a86d9b3b2c24faff68489f4880..ee5909630c0419840269f18b6f55e329e02e6bd2 100644 (file)
@@ -32,17 +32,7 @@ OptionCustom::OptionCustom(const OptionDefinition& def,
                              const OptionBuffer& data)
     : Option(u, def.getCode(), data.begin(), data.end()),
       definition_(def) {
-    // It is possible that no data is provided if an option
-    // is being created on a server side. In such case a bunch
-    // of buffers with default values is first created and then
-    // the values are replaced using writeXXX functions. Thus
-    // we need to detect that no data has been specified and
-    // take a different code path.
-    if (!data_.empty()) {
-        createBuffers(data_);
-    } else {
-        createBuffers();
-    }
+    createBuffers(data_);
 }
 
 OptionCustom::OptionCustom(const OptionDefinition& def,