Commit 11e65849 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[2312] Added missing check for empty vector.

parent 2c10fa49
......@@ -214,7 +214,7 @@ OptionCustom::pack4(isc::util::OutputBuffer& buf) {
// In theory the createBuffers function should have taken
// care that there are no empty buffers added to the
// collection but it is almost always good to make sure.
if (it->size() > 0) {
if (!it->empty()) {
buf.writeData(&(*it)[0], it->size());
}
}
......@@ -231,7 +231,9 @@ OptionCustom::pack6(isc::util::OutputBuffer& buf) {
// Write data from buffers.
for (std::vector<OptionBuffer>::const_iterator it = buffers_.begin();
it != buffers_.end(); ++it) {
buf.writeData(&(*it)[0], it->size());
if (!it->empty()) {
buf.writeData(&(*it)[0], it->size());
}
}
LibDHCP::packOptions(buf, options_);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment