BIND 10 trac2491, updated. eb5b276de3dc4c556c818ebfab63a14bf2f562eb [2491] Use insert instead of memcpy to append to a vector.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Dec 10 17:32:51 UTC 2012


The branch, trac2491 has been updated
       via  eb5b276de3dc4c556c818ebfab63a14bf2f562eb (commit)
      from  1572782282cd6b5835ad20f5d8538511616a7e2b (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 -----------------------------------------------------------------
commit eb5b276de3dc4c556c818ebfab63a14bf2f562eb
Author: Marcin Siodelski <marcin at isc.org>
Date:   Mon Dec 10 18:32:42 2012 +0100

    [2491] Use insert instead of memcpy to append to a vector.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dhcp/option_data_types.cc |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/option_data_types.cc b/src/lib/dhcp/option_data_types.cc
index a0e29aa..ce6f8c2 100644
--- a/src/lib/dhcp/option_data_types.cc
+++ b/src/lib/dhcp/option_data_types.cc
@@ -236,11 +236,9 @@ OptionDataTypeUtil::writeFqdn(const std::string& fqdn,
         isc::dns::Name name(fqdn);
         isc::dns::LabelSequence labels(name);
         if (labels.getDataLength() > 0) {
-            buf.resize(buf.size() + labels.getDataLength());
             size_t read_len = 0;
             const uint8_t* data = labels.getData(&read_len);
-            memcpy(static_cast<void*>(&buf[buf.size() - read_len]),
-                   data, read_len);
+            buf.insert(buf.end(), data, data + read_len);
         }
     } catch (const isc::Exception& ex) {
         isc_throw(BadDataTypeCast, ex.what());



More information about the bind10-changes mailing list