From: Marcin Siodelski Date: Thu, 16 May 2013 08:28:19 +0000 (+0200) Subject: [2786] Always validate the contents of the buffer when provided. X-Git-Tag: bind10-1.2.0beta1-release~442^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee886b45eb503cf048abf8416ce7b37430f6fb25;p=thirdparty%2Fkea.git [2786] Always validate the contents of the buffer when provided. --- diff --git a/src/lib/dhcp/option_custom.cc b/src/lib/dhcp/option_custom.cc index e807928da1..ee5909630c 100644 --- a/src/lib/dhcp/option_custom.cc +++ b/src/lib/dhcp/option_custom.cc @@ -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,