BIND 10 trac2512, updated. 79defea75c875181597598e880ee20af3016167f [2512] Update check to an assertion

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Feb 6 12:23:13 UTC 2014


The branch, trac2512 has been updated
       via  79defea75c875181597598e880ee20af3016167f (commit)
      from  11052a822a6c329a087e5590ac525ab3107926a8 (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 79defea75c875181597598e880ee20af3016167f
Author: Mukund Sivaraman <muks at isc.org>
Date:   Thu Feb 6 17:51:17 2014 +0530

    [2512] Update check to an assertion
    
    All the constructors currently check that the tag field is not empty.

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

Summary of changes:
 src/lib/dns/rdata/generic/caa_257.cc |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata/generic/caa_257.cc b/src/lib/dns/rdata/generic/caa_257.cc
index 47366d6..ecaf559 100644
--- a/src/lib/dns/rdata/generic/caa_257.cc
+++ b/src/lib/dns/rdata/generic/caa_257.cc
@@ -242,11 +242,12 @@ CAA::~CAA() {
 void
 CAA::toWire(OutputBuffer& buffer) const {
     buffer.writeUint8(impl_->flags_);
+
+    // The constructors must ensure that the tag field is not empty.
+    assert(!impl_->tag_.empty());
     buffer.writeUint8(impl_->tag_.size());
-    if (!impl_->tag_.empty()) {
-        buffer.writeData(&impl_->tag_[0],
-                         impl_->tag_.size());
-    }
+    buffer.writeData(&impl_->tag_[0], impl_->tag_.size());
+
     if (impl_->value_.size() > 1) {
         buffer.writeData(&impl_->value_[1],
                          impl_->value_.size() - 1);
@@ -256,11 +257,12 @@ CAA::toWire(OutputBuffer& buffer) const {
 void
 CAA::toWire(AbstractMessageRenderer& renderer) const {
     renderer.writeUint8(impl_->flags_);
+
+    // The constructors must ensure that the tag field is not empty.
+    assert(!impl_->tag_.empty());
     renderer.writeUint8(impl_->tag_.size());
-    if (!impl_->tag_.empty()) {
-        renderer.writeData(&impl_->tag_[0],
-                           impl_->tag_.size());
-    }
+    renderer.writeData(&impl_->tag_[0], impl_->tag_.size());
+
     if (impl_->value_.size() > 1) {
         renderer.writeData(&impl_->value_[1],
                            impl_->value_.size() - 1);



More information about the bind10-changes mailing list