BIND 10 trac2312, updated. 11e658493d1672d39194580ffb1dde98101608a9 [2312] Added missing check for empty vector.

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Nov 29 10:27:31 UTC 2012


The branch, trac2312 has been updated
       via  11e658493d1672d39194580ffb1dde98101608a9 (commit)
      from  2c10fa4964550d7402ee0fc93401f8ad39f29e87 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 src/lib/dhcp/option_custom.cc |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/option_custom.cc b/src/lib/dhcp/option_custom.cc
index e5bc43c..3bf99b7 100644
--- a/src/lib/dhcp/option_custom.cc
+++ b/src/lib/dhcp/option_custom.cc
@@ -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_);



More information about the bind10-changes mailing list