BIND 10 trac3059, updated. 4f2cfbfa1b3edf01bab9c4d8b38a651ab857f52d [3059] Removed the C-string from the DdnsDomainListMgr::matchDomain.

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Aug 7 07:43:24 UTC 2013


The branch, trac3059 has been updated
       via  4f2cfbfa1b3edf01bab9c4d8b38a651ab857f52d (commit)
      from  40b956102de5751498e0acc27dbf99a7c554d627 (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 4f2cfbfa1b3edf01bab9c4d8b38a651ab857f52d
Author: Marcin Siodelski <marcin at isc.org>
Date:   Wed Aug 7 09:43:09 2013 +0200

    [3059] Removed the C-string from the DdnsDomainListMgr::matchDomain.

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

Summary of changes:
 src/bin/d2/d2_config.cc |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/d2/d2_config.cc b/src/bin/d2/d2_config.cc
index 9b87dc7..1e299ef 100644
--- a/src/bin/d2/d2_config.cc
+++ b/src/bin/d2/d2_config.cc
@@ -103,7 +103,6 @@ DdnsDomainListMgr::matchDomain(const std::string& fqdn, DdnsDomainPtr& domain) {
     // Iterate over the domain map looking for the domain which matches
     // the longest portion of the given fqdn.
 
-    const char* req_name = fqdn.c_str();
     size_t req_len = fqdn.size();
     size_t match_len = 0;
     DdnsDomainMapPair map_pair;
@@ -118,7 +117,7 @@ DdnsDomainListMgr::matchDomain(const std::string& fqdn, DdnsDomainPtr& domain) {
 
         // If the lengths are identical and the names match we're done.
         if (req_len == dom_len) {
-            if (req_name == domain_name) {
+            if (fqdn == domain_name) {
                 // exact match, done
                 domain = map_pair.second;
                 return (true);
@@ -129,7 +128,7 @@ DdnsDomainListMgr::matchDomain(const std::string& fqdn, DdnsDomainPtr& domain) {
             // comparison if the adjustment lands on a boundary. This
             // prevents "onetwo.net" from matching "two.net".
             size_t offset = req_len - dom_len;
-            if ((req_name[offset - 1] == '.')  &&
+            if ((fqdn[offset - 1] == '.')  &&
                (fqdn.compare(offset, std::string::npos, domain_name) == 0)) {
                 // Fqdn contains domain name, keep it if its better than
                 // any we have matched so far.



More information about the bind10-changes mailing list