]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add RUNTIME_CHECK() around plain dns_name_copy(..., NULL) calls using spatch
authorOndřej Surý <ondrej@sury.org>
Tue, 10 Sep 2019 11:16:48 +0000 (13:16 +0200)
committerMark Andrews <marka@isc.org>
Fri, 4 Oct 2019 04:08:25 +0000 (14:08 +1000)
This commit add RUNTIME_CHECK() around all simple dns_name_copy() calls where
the third argument is NULL using the semantic patch from the previous commit.

(cherry picked from commit 35bd7e4da0c59a912cd0785dff11aafc4026253b)

23 files changed:
bin/dig/dighost.c
bin/dig/host.c
bin/dig/nslookup.c
bin/dnssec/dnssec-signzone.c
bin/nsupdate/nsupdate.c
lib/dns/journal.c
lib/dns/masterdump.c
lib/dns/nsec3.c
lib/dns/nta.c
lib/dns/rbtdb.c
lib/dns/rdataset.c
lib/dns/resolver.c
lib/dns/rrl.c
lib/dns/sdb.c
lib/dns/sdlz.c
lib/dns/tkey.c
lib/dns/validator.c
lib/dns/view.c
lib/dns/zone.c
lib/dns/zoneverify.c
lib/ns/query.c
lib/ns/update.c
lib/samples/nsprobe.c

index 7e8886061eb4eba231721ad5cf3f9451c87b3027..07d0da597239f07091c0e45d03d82462983c15d0 100644 (file)
@@ -810,8 +810,7 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
                memmove(looknew->ecs_addr, lookold->ecs_addr, len);
        }
 
-       dns_name_copy(dns_fixedname_name(&lookold->fdomain),
-                     dns_fixedname_name(&looknew->fdomain), NULL);
+       RUNTIME_CHECK(dns_name_copy(dns_fixedname_name(&lookold->fdomain), dns_fixedname_name(&looknew->fdomain), NULL) == ISC_R_SUCCESS);
 
        if (servers)
                clone_server_list(lookold->my_server_list,
@@ -1824,7 +1823,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section)
                                if (lookup->ns_search_only)
                                        lookup->recurse = false;
                                domain = dns_fixedname_name(&lookup->fdomain);
-                               dns_name_copy(name, domain, NULL);
+                               RUNTIME_CHECK(dns_name_copy(name, domain, NULL) == ISC_R_SUCCESS);
                        }
                        debug("adding server %s", namestr);
                        num = getaddresses(lookup, namestr, &lresult);
index 91f97cefc4198a32921e93a859b5d4980d579b4c..5770ef30373aa9047b08cc47a143bfc9ed1012b4 100644 (file)
@@ -396,7 +396,7 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
                dns_rdataset_current(rdataset, &rdata);
                result = dns_rdata_tostruct(&rdata, &cname, NULL);
                check_result(result, "dns_rdata_tostruct");
-               dns_name_copy(&cname.cname, qname, NULL);
+               RUNTIME_CHECK(dns_name_copy(&cname.cname, qname, NULL) == ISC_R_SUCCESS);
                dns_rdata_freestruct(&cname);
        }
 }
@@ -455,7 +455,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
 
                /* Add AAAA and MX lookups. */
                name = dns_fixedname_initname(&fixed);
-               dns_name_copy(query->lookup->name, name, NULL);
+               RUNTIME_CHECK(dns_name_copy(query->lookup->name, name, NULL) == ISC_R_SUCCESS);
                chase_cnamechain(msg, name);
                dns_name_format(name, namestr, sizeof(namestr));
                lookup = clone_lookup(query->lookup, false);
index bbabf0e0f5c3ab6155b8627cbc2994c23e5bb908..e0240b2ef056eb744c6ab2941cce881cfe50e900 100644 (file)
@@ -425,7 +425,7 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
                dns_rdataset_current(rdataset, &rdata);
                result = dns_rdata_tostruct(&rdata, &cname, NULL);
                check_result(result, "dns_rdata_tostruct");
-               dns_name_copy(&cname.cname, qname, NULL);
+               RUNTIME_CHECK(dns_name_copy(&cname.cname, qname, NULL) == ISC_R_SUCCESS);
                dns_rdata_freestruct(&cname);
        }
 }
@@ -478,7 +478,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
 
                /* Add AAAA lookup. */
                name = dns_fixedname_initname(&fixed);
-               dns_name_copy(query->lookup->name, name, NULL);
+               RUNTIME_CHECK(dns_name_copy(query->lookup->name, name, NULL) == ISC_R_SUCCESS);
                chase_cnamechain(msg, name);
                dns_name_format(name, namestr, sizeof(namestr));
                lookup = clone_lookup(query->lookup, false);
index 7e2e6c67c1c7691ef30d25141f47ec5b8bc4bc69..45e589d2875cbca9993ffdba5f55382a5ee73598 100644 (file)
@@ -204,7 +204,7 @@ savezonecut(dns_fixedname_t *fzonecut, dns_name_t *name) {
        dns_name_t *result;
 
        result = dns_fixedname_initname(fzonecut);
-       dns_name_copy(name, result, NULL);
+       RUNTIME_CHECK(dns_name_copy(name, result, NULL) == ISC_R_SUCCESS);
 
        return (result);
 }
@@ -2346,7 +2346,7 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
                        break;
                }
                if (result == ISC_R_NOMORE) {
-                       dns_name_copy(gorigin, nextname, NULL);
+                       RUNTIME_CHECK(dns_name_copy(gorigin, nextname, NULL) == ISC_R_SUCCESS);
                        done = true;
                } else if (result != ISC_R_SUCCESS)
                        fatal("iterating through the database failed: %s",
@@ -2480,7 +2480,7 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
                        break;
                }
                if (result == ISC_R_NOMORE) {
-                       dns_name_copy(gorigin, nextname, NULL);
+                       RUNTIME_CHECK(dns_name_copy(gorigin, nextname, NULL) == ISC_R_SUCCESS);
                        done = true;
                } else if (result != ISC_R_SUCCESS)
                        fatal("iterating through the database failed: %s",
index 0ebd1feab3fb2f7857bb768dd700fe016fdcd5f4..95d9f59a1637e3a83ddfa279d2ee1c5e37c1d035 100644 (file)
@@ -2636,7 +2636,7 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
                 * address.
                 */
                zname = dns_fixedname_initname(&fzname);
-               dns_name_copy(name, zname, NULL);
+               RUNTIME_CHECK(dns_name_copy(name, zname, NULL) == ISC_R_SUCCESS);
        }
 
        if (debugging) {
index 4a820382860b9debdc46b1a9fa256de2ca0915a2..fd679704cbb3897e0766265bf1cd7e9ab5ea46bf 100644 (file)
@@ -132,7 +132,7 @@ dns_db_createsoatuple(dns_db_t *db, dns_dbversion_t *ver, isc_mem_t *mctx,
        dns_name_t *zonename;
 
        zonename = dns_fixedname_initname(&fixed);
-       dns_name_copy(dns_db_origin(db), zonename, NULL);
+       RUNTIME_CHECK(dns_name_copy(dns_db_origin(db), zonename, NULL) == ISC_R_SUCCESS);
 
        node = NULL;
        result = dns_db_findnode(db, zonename, false, &node);
index cb7c171b6a21acecf6cb5e666f2d529b03e5aea9..1faab950ec564fc80f4a3a1066a23033d3cc872b 100644 (file)
@@ -502,7 +502,7 @@ rdataset_totext(dns_rdataset_t *rdataset,
 
        if (owner_name != NULL) {
                name = dns_fixedname_initname(&fixed);
-               dns_name_copy(owner_name, name, NULL);
+               RUNTIME_CHECK(dns_name_copy(owner_name, name, NULL) == ISC_R_SUCCESS);
                dns_rdataset_getownercase(rdataset, name);
        }
 
@@ -1203,7 +1203,7 @@ dump_rdatasets_raw(isc_mem_t *mctx, const dns_name_t *owner_name,
        dns_name_t *name;
 
        name = dns_fixedname_initname(&fixed);
-       dns_name_copy(owner_name, name, NULL);
+       RUNTIME_CHECK(dns_name_copy(owner_name, name, NULL) == ISC_R_SUCCESS);
        for (result = dns_rdatasetiter_first(rdsiter);
             result == ISC_R_SUCCESS;
             result = dns_rdatasetiter_next(rdsiter)) {
index 9bd2b5781d7fcef059310994d941b6512bd9057f..fd10a20c8b182af0b866df93cc62edf0b6f08468 100644 (file)
@@ -1929,7 +1929,7 @@ dns_nsec3_noexistnodata(dns_rdatatype_t type, const dns_name_t *name,
         */
        if (dns_name_countlabels(zonename) == 0 ||
            dns_name_issubdomain(zone, zonename))
-               dns_name_copy(zone, zonename, NULL);
+               RUNTIME_CHECK(dns_name_copy(zone, zonename, NULL) == ISC_R_SUCCESS);
 
        if (!dns_name_equal(zone, zonename))
                return (ISC_R_IGNORE);
@@ -2072,7 +2072,7 @@ dns_nsec3_noexistnodata(dns_rdatatype_t type, const dns_name_t *name,
                                (*logit)(arg, ISC_LOG_DEBUG(3),
                                         "NSEC3 indicates potential closest "
                                         "encloser: '%s'", namebuf);
-                               dns_name_copy(qname, closest, NULL);
+                               RUNTIME_CHECK(dns_name_copy(qname, closest, NULL) == ISC_R_SUCCESS);
                                *setclosest = true;
                        }
                        dns_name_format(qname, namebuf, sizeof(namebuf));
@@ -2103,7 +2103,7 @@ dns_nsec3_noexistnodata(dns_rdatatype_t type, const dns_name_t *name,
                        if (nearest != NULL &&
                            (dns_name_countlabels(nearest) == 0 ||
                             dns_name_issubdomain(nearest, qname))) {
-                               dns_name_copy(qname, nearest, NULL);
+                               RUNTIME_CHECK(dns_name_copy(qname, nearest, NULL) == ISC_R_SUCCESS);
                                *setnearest = true;
                        }
 
index 498b7f1933254778cb5f4f301305c519d787a280..2611b11a69eea2f7730779da512e376d64919287 100644 (file)
@@ -329,7 +329,7 @@ nta_create(dns_ntatable_t *ntatable, const dns_name_t *name,
        isc_refcount_init(&nta->refcount, 1);
 
        nta->name = dns_fixedname_initname(&nta->fn);
-       dns_name_copy(name, nta->name, NULL);
+       RUNTIME_CHECK(dns_name_copy(name, nta->name, NULL) == ISC_R_SUCCESS);
 
        nta->magic = NTA_MAGIC;
 
index 64f6becbecb2dd78a958c186e14356720b3ab3a1..af28bd569d4142a4ab8bfae1d394e19edab1510e 100644 (file)
@@ -5117,7 +5117,7 @@ cache_findzonecut(dns_db_t *db, const dns_name_t *name, unsigned int options,
        } else if (result != ISC_R_SUCCESS) {
                goto tree_exit;
        } else if (!dcnull) {
-               dns_name_copy(dcname, foundname, NULL);
+               RUNTIME_CHECK(dns_name_copy(dcname, foundname, NULL) == ISC_R_SUCCESS);
        }
        /*
         * We now go looking for an NS rdataset at the node.
@@ -9379,7 +9379,8 @@ dbiterator_origin(dns_dbiterator_t *iterator, dns_name_t *name) {
        if (rbtdbiter->result != ISC_R_SUCCESS)
                return (rbtdbiter->result);
 
-       return (dns_name_copy(origin, name, NULL));
+       RUNTIME_CHECK(dns_name_copy(origin, name, NULL) == ISC_R_SUCCESS);
+       return (ISC_R_SUCCESS);
 }
 
 static void
@@ -9754,7 +9755,7 @@ glue_nsdname_cb(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
                }
 
                gluename = dns_fixedname_initname(&glue->fixedname);
-               dns_name_copy(name_a, gluename, NULL);
+               RUNTIME_CHECK(dns_name_copy(name_a, gluename, NULL) == ISC_R_SUCCESS);
 
                dns_rdataset_init(&glue->rdataset_a);
                dns_rdataset_init(&glue->sigrdataset_a);
@@ -9782,7 +9783,7 @@ glue_nsdname_cb(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
                        }
 
                        gluename = dns_fixedname_initname(&glue->fixedname);
-                       dns_name_copy(name_aaaa, gluename, NULL);
+                       RUNTIME_CHECK(dns_name_copy(name_aaaa, gluename, NULL) == ISC_R_SUCCESS);
 
                        dns_rdataset_init(&glue->rdataset_a);
                        dns_rdataset_init(&glue->sigrdataset_a);
index 576e9475b5a279a01d14f4b14d356354a194723b..48110ae4fa232df8ca66e329929c929705c6db75 100644 (file)
@@ -456,7 +456,7 @@ towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
        added = 0;
 
        name = dns_fixedname_initname(&fixed);
-       dns_name_copy(owner_name, name, NULL);
+       RUNTIME_CHECK(dns_name_copy(owner_name, name, NULL) == ISC_R_SUCCESS);
        dns_rdataset_getownercase(rdataset, name);
        offset = 0xffff;
 
index 37e1e3e5d3ee0be5410c8cc3eb2708e161189a30..f38c1e6a1c267dc8913302e4dbe2d05b64d8d050 100644 (file)
@@ -1519,9 +1519,8 @@ fcount_incr(fetchctx_t *fctx, bool force) {
                        counter->logged = 0;
                        counter->allowed = 1;
                        counter->dropped = 0;
-                       counter->domain =
-                               dns_fixedname_initname(&counter->fdname);
-                       dns_name_copy(&fctx->domain, counter->domain, NULL);
+                       counter->domain = dns_fixedname_initname(&counter->fdname);
+                       RUNTIME_CHECK(dns_name_copy(&fctx->domain, counter->domain, NULL) == ISC_R_SUCCESS);
                        ISC_LIST_APPEND(dbucket->list, counter, link);
                }
        } else {
@@ -5396,8 +5395,7 @@ validated(isc_task_t *task, isc_event_t *event) {
         */
        if (vevent->proofs[DNS_VALIDATOR_NOQNAMEPROOF] != NULL) {
                wild = dns_fixedname_initname(&fwild);
-               dns_name_copy(dns_fixedname_name(&vevent->validator->wild),
-                             wild, NULL);
+               RUNTIME_CHECK(dns_name_copy(dns_fixedname_name(&vevent->validator->wild), wild, NULL) == ISC_R_SUCCESS);
        }
        dns_validator_destroy(&vevent->validator);
        isc_mem_put(fctx->mctx, valarg, sizeof(*valarg));
@@ -7150,7 +7148,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
                 * Retrieve state from fctx->nsfetch before we destroy it.
                 */
                domain = dns_fixedname_initname(&fixed);
-               dns_name_copy(&fctx->nsfetch->private->domain, domain, NULL);
+               RUNTIME_CHECK(dns_name_copy(&fctx->nsfetch->private->domain, domain, NULL) == ISC_R_SUCCESS);
                if (dns_name_equal(&fctx->nsname, domain)) {
                        if (dns_rdataset_isassociated(fevent->rdataset)) {
                                dns_rdataset_disassociate(fevent->rdataset);
index b603a98dda69979f00e90431be486b750470efef..a6b353376a27adea19435a7a9de1aaae09303daf 100644 (file)
@@ -910,9 +910,7 @@ make_log_buf(dns_rrl_t *rrl, dns_rrl_entry_t *e,
                                e->log_qname = qbuf->index;
                                qbuf->e = e;
                                dns_fixedname_init(&qbuf->qname);
-                               dns_name_copy(qname,
-                                             dns_fixedname_name(&qbuf->qname),
-                                             NULL);
+                               RUNTIME_CHECK(dns_name_copy(qname, dns_fixedname_name(&qbuf->qname), NULL) == ISC_R_SUCCESS);
                        }
                }
                if (qbuf != NULL)
index a62cc946c3acf1e18b98eb2e93bde9eac0ccb0fb..88c62878c829b485e7a9723d2c213eac6d0e4701 100644 (file)
@@ -1602,8 +1602,10 @@ dbiterator_current(dns_dbiterator_t *iterator, dns_dbnode_t **nodep,
        sdb_dbiterator_t *sdbiter = (sdb_dbiterator_t *)iterator;
 
        attachnode(iterator->db, sdbiter->current, nodep);
-       if (name != NULL)
-               return (dns_name_copy(sdbiter->current->name, name, NULL));
+       if (name != NULL) {
+               RUNTIME_CHECK(dns_name_copy(sdbiter->current->name, name, NULL) == ISC_R_SUCCESS);
+               return (ISC_R_SUCCESS);
+       }
        return (ISC_R_SUCCESS);
 }
 
@@ -1616,7 +1618,8 @@ dbiterator_pause(dns_dbiterator_t *iterator) {
 static isc_result_t
 dbiterator_origin(dns_dbiterator_t *iterator, dns_name_t *name) {
        UNUSED(iterator);
-       return (dns_name_copy(dns_rootname, name, NULL));
+       RUNTIME_CHECK(dns_name_copy(dns_rootname, name, NULL) == ISC_R_SUCCESS);
+       return (ISC_R_SUCCESS);
 }
 
 /*
index 70568b72334a676cf0ace792075abdb58318958c..61f275fa0fdad93a76f143873a0f784d2ca2c7cd 100644 (file)
@@ -1424,8 +1424,10 @@ dbiterator_current(dns_dbiterator_t *iterator, dns_dbnode_t **nodep,
        sdlz_dbiterator_t *sdlziter = (sdlz_dbiterator_t *)iterator;
 
        attachnode(iterator->db, sdlziter->current, nodep);
-       if (name != NULL)
-               return (dns_name_copy(sdlziter->current->name, name, NULL));
+       if (name != NULL) {
+               RUNTIME_CHECK(dns_name_copy(sdlziter->current->name, name, NULL) == ISC_R_SUCCESS);
+               return (ISC_R_SUCCESS);
+       }
        return (ISC_R_SUCCESS);
 }
 
@@ -1438,7 +1440,8 @@ dbiterator_pause(dns_dbiterator_t *iterator) {
 static isc_result_t
 dbiterator_origin(dns_dbiterator_t *iterator, dns_name_t *name) {
        UNUSED(iterator);
-       return (dns_name_copy(dns_rootname, name, NULL));
+       RUNTIME_CHECK(dns_name_copy(dns_rootname, name, NULL) == ISC_R_SUCCESS);
+       return (ISC_R_SUCCESS);
 }
 
 /*
index c08b52a75db120ea067c5913eccb7b5600568b90..437d7dedce0b2f93d5956895d5cf423345cee9e6 100644 (file)
@@ -1513,7 +1513,7 @@ dns_tkey_gssnegotiate(dns_message_t *qmsg, dns_message_t *rmsg,
                dns_fixedname_t fixed;
 
                dns_fixedname_init(&fixed);
-               dns_name_copy(tkeyname, dns_fixedname_name(&fixed), NULL);
+               RUNTIME_CHECK(dns_name_copy(tkeyname, dns_fixedname_name(&fixed), NULL) == ISC_R_SUCCESS);
                tkeyname = dns_fixedname_name(&fixed);
 
                tkey.common.rdclass = dns_rdataclass_any;
index 7c2d5feaeb43a7291fd25db4b6fec032d0620691..4600806b4f6ea7e3ea833a25152dba1a67711199 100644 (file)
@@ -1543,7 +1543,7 @@ verify(dns_validator_t *val, dst_key_t *key, dns_rdata_t *rdata,
                         * for the NSEC3 NOQNAME proof.
                         */
                        closest = dns_fixedname_name(&val->closest);
-                       dns_name_copy(wild, closest, NULL);
+                       RUNTIME_CHECK(dns_name_copy(wild, closest, NULL) == ISC_R_SUCCESS);
                        labels = dns_name_countlabels(closest) - 1;
                        dns_name_getlabelsequence(closest, 1, labels, closest);
                        val->attributes |= VALATTR_NEEDNOQNAME;
@@ -2544,7 +2544,7 @@ findnsec3proofs(dns_validator_t *val) {
                                 namebuf, sizeof(namebuf));
                validator_log(val, ISC_LOG_DEBUG(3), "closest encloser from "
                              "wildcard signature '%s'", namebuf);
-               dns_name_copy(dns_fixedname_name(&val->closest), closest, NULL);
+               RUNTIME_CHECK(dns_name_copy(dns_fixedname_name(&val->closest), closest, NULL) == ISC_R_SUCCESS);
                closestp = NULL;
                setclosestp = NULL;
        } else {
@@ -3280,9 +3280,9 @@ proveunsecure(dns_validator_t *val, bool have_ds, bool resume)
 
        secroot = dns_fixedname_initname(&fixedsecroot);
        found = dns_fixedname_initname(&fixedfound);
-       if (val->havedlvsep)
-               dns_name_copy(dns_fixedname_name(&val->dlvsep), secroot, NULL);
-       else {
+       if (val->havedlvsep) {
+               RUNTIME_CHECK(dns_name_copy(val->event->name, secroot, NULL) == ISC_R_SUCCESS);
+       else {
                unsigned int labels;
                dns_name_copy(val->event->name, secroot, NULL);
                /*
@@ -3363,7 +3363,7 @@ proveunsecure(dns_validator_t *val, bool have_ds, bool resume)
 
                tname = dns_fixedname_initname(&val->fname);
                if (val->labels == dns_name_countlabels(val->event->name))
-                       dns_name_copy(val->event->name, tname, NULL);
+                       RUNTIME_CHECK(dns_name_copy(val->event->name, tname, NULL) == ISC_R_SUCCESS);
                else
                        dns_name_split(val->event->name, val->labels,
                                       NULL, tname);
index 463f78b2755a3edd89127303d4f2703fb56636be..25efba959b2a40f1f47263212e38cdf5df94316e 100644 (file)
@@ -1405,7 +1405,7 @@ dns_view_findzonecut(dns_view_t *view, const dns_name_t *name,
                                dns_rdataset_disassociate(rdataset);
                        result = ISC_R_NOTFOUND;
                } else if (dcname != NULL) {
-                       dns_name_copy(fname, dcname, NULL);
+                       RUNTIME_CHECK(dns_name_copy(fname, dcname, NULL) == ISC_R_SUCCESS);
                }
        }
 
index c568e6a4469ebe8dfc6462227aa40f4fc8038e4c..03bc83e1fa28ab8a72a08ddfa113e03aefae05d6 100644 (file)
@@ -3110,7 +3110,7 @@ integrity_checks(dns_zone_t *zone, dns_db_t *db) {
                /*
                 * Remember bottom of zone due to NS.
                 */
-               dns_name_copy(name, bottom, NULL);
+               RUNTIME_CHECK(dns_name_copy(name, bottom, NULL) == ISC_R_SUCCESS);
 
                result = dns_rdataset_first(&rdataset);
                while (result == ISC_R_SUCCESS) {
@@ -3133,7 +3133,7 @@ integrity_checks(dns_zone_t *zone, dns_db_t *db) {
                        /*
                         * Remember bottom of zone due to DNAME.
                         */
-                       dns_name_copy(name, bottom, NULL);
+                       RUNTIME_CHECK(dns_name_copy(name, bottom, NULL) == ISC_R_SUCCESS);
                        dns_rdataset_disassociate(&rdataset);
                }
 
@@ -7921,7 +7921,7 @@ zone_nsec3chain(dns_zone_t *zone) {
                                 * Remember the obscuring name so that
                                 * we skip all obscured names.
                                 */
-                               dns_name_copy(found, name, NULL);
+                               RUNTIME_CHECK(dns_name_copy(found, name, NULL) == ISC_R_SUCCESS);
                                delegation = true;
                                goto next_addnode;
                        }
@@ -8184,7 +8184,7 @@ zone_nsec3chain(dns_zone_t *zone) {
                                 * Remember the obscuring name so that
                                 * we skip all obscured names.
                                 */
-                               dns_name_copy(found, name, NULL);
+                               RUNTIME_CHECK(dns_name_copy(found, name, NULL) == ISC_R_SUCCESS);
                                delegation = true;
                                goto next_removenode;
                        }
@@ -8906,7 +8906,7 @@ zone_sign(dns_zone_t *zone) {
                                 * Remember the obscuring name so that
                                 * we skip all obscured names.
                                 */
-                               dns_name_copy(found, name, NULL);
+                               RUNTIME_CHECK(dns_name_copy(found, name, NULL) == ISC_R_SUCCESS);
                                is_bottom_of_zone = true;
                                goto next_node;
                        }
index 9d92f147e42bea3cf049d955bd8d64cafb1c9f17..6aba5546d6860ef0dd2e6d5e09de8c964058890c 100644 (file)
@@ -1799,11 +1799,11 @@ verify_nodes(vctx_t *vctx, isc_result_t *vresult) {
                }
                if (is_delegation(vctx, name, node, NULL)) {
                        zonecut = dns_fixedname_name(&fzonecut);
-                       dns_name_copy(name, zonecut, NULL);
+                       RUNTIME_CHECK(dns_name_copy(name, zonecut, NULL) == ISC_R_SUCCESS);
                        isdelegation = true;
                } else if (has_dname(vctx, node)) {
                        zonecut = dns_fixedname_name(&fzonecut);
-                       dns_name_copy(name, zonecut, NULL);
+                       RUNTIME_CHECK(dns_name_copy(name, zonecut, NULL) == ISC_R_SUCCESS);
                }
                nextnode = NULL;
                result = dns_dbiterator_next(dbiter);
@@ -1884,7 +1884,7 @@ verify_nodes(vctx_t *vctx, isc_result_t *vresult) {
                } else {
                        prevname = dns_fixedname_name(&fprevname);
                }
-               dns_name_copy(name, prevname, NULL);
+               RUNTIME_CHECK(dns_name_copy(name, prevname, NULL) == ISC_R_SUCCESS);
                if (*vresult == ISC_R_SUCCESS) {
                        *vresult = tvresult;
                }
index 9f18723c6e4689da031497484fcedf096a8118ec..0777a7cf5f552e97cc216191063fa34c28cf575e 100644 (file)
@@ -2839,7 +2839,7 @@ rpz_rrset_find(ns_client_t *client, dns_name_t *name, dns_rdatatype_t type,
                        query_rpzfetch(client, name, type);
                        result = DNS_R_NXRRSET;
                } else {
-                       dns_name_copy(name, st->r_name, NULL);
+                       RUNTIME_CHECK(dns_name_copy(name, st->r_name, NULL) == ISC_R_SUCCESS);
                        result = ns_query_recurse(client, type, st->r_name,
                                                  NULL, NULL, resuming);
                        if (result == ISC_R_SUCCESS) {
@@ -3101,7 +3101,7 @@ rpz_save_p(dns_rpz_st_t *st, dns_rpz_zone_t *rpz, dns_rpz_type_t rpz_type,
        st->m.rpz = rpz;
        st->m.type = rpz_type;
        st->m.policy = policy;
-       dns_name_copy(p_name, st->p_name, NULL);
+       RUNTIME_CHECK(dns_name_copy(p_name, st->p_name, NULL) == ISC_R_SUCCESS);
        st->m.prefix = prefix;
        st->m.result = result;
        SAVE(st->m.zone, *zonep);
@@ -4602,7 +4602,7 @@ query_findclosestnsec3(dns_name_t *qname, dns_db_t *db,
                        dns_name_getlabelsequence(qname, skip, labels - skip,
                                                  found);
        } else if (found != NULL)
-               dns_name_copy(&name, found, NULL);
+               RUNTIME_CHECK(dns_name_copy(&name, found, NULL) == ISC_R_SUCCESS);
        return;
 }
 
@@ -4791,7 +4791,7 @@ redirect(ns_client_t *client, dns_name_t *name, dns_rdataset_t *rdataset,
        }
 
        CTRACE(ISC_LOG_DEBUG(3), "redirect: found data: done");
-       dns_name_copy(found, name, NULL);
+       RUNTIME_CHECK(dns_name_copy(found, name, NULL) == ISC_R_SUCCESS);
        if (dns_rdataset_isassociated(rdataset))
                dns_rdataset_disassociate(rdataset);
        if (dns_rdataset_isassociated(&trdataset)) {
@@ -4891,7 +4891,7 @@ redirect2(ns_client_t *client, dns_name_t *name, dns_rdataset_t *rdataset,
                if (result != ISC_R_SUCCESS)
                        return (ISC_R_NOTFOUND);
        } else {
-               dns_name_copy(redirectname, client->view->redirectzone, NULL);
+               RUNTIME_CHECK(dns_name_copy(redirectname, client->view->redirectzone, NULL) == ISC_R_SUCCESS);
        }
 
        options = 0;
@@ -4961,7 +4961,7 @@ redirect2(ns_client_t *client, dns_name_t *name, dns_rdataset_t *rdataset,
        result = dns_name_concatenate(found, dns_rootname, found, NULL);
        RUNTIME_CHECK(result == ISC_R_SUCCESS);
 
-       dns_name_copy(found, name, NULL);
+       RUNTIME_CHECK(dns_name_copy(found, name, NULL) == ISC_R_SUCCESS);
        if (dns_rdataset_isassociated(rdataset))
                dns_rdataset_disassociate(rdataset);
        if (dns_rdataset_isassociated(&trdataset)) {
@@ -6346,7 +6346,7 @@ query_checkrpz(query_ctx_t *qctx, isc_result_t result) {
                SAVE(qctx->rpz_st->q.node, qctx->node);
                SAVE(qctx->rpz_st->q.rdataset, qctx->rdataset);
                SAVE(qctx->rpz_st->q.sigrdataset, qctx->sigrdataset);
-               dns_name_copy(qctx->fname, qctx->rpz_st->fname, NULL);
+               RUNTIME_CHECK(dns_name_copy(qctx->fname, qctx->rpz_st->fname, NULL) == ISC_R_SUCCESS);
                qctx->rpz_st->q.result = result;
                qctx->client->query.attributes |= NS_QUERYATTR_RECURSING;
                return (ISC_R_COMPLETE);
@@ -7777,7 +7777,7 @@ query_prepare_delegation_response(query_ctx_t *qctx) {
         * it here in case we need it.
         */
        dns_fixedname_init(&qctx->dsname);
-       dns_name_copy(qctx->fname, dns_fixedname_name(&qctx->dsname), NULL);
+       RUNTIME_CHECK(dns_name_copy(qctx->fname, dns_fixedname_name(&qctx->dsname), NULL) == ISC_R_SUCCESS);
 
        /*
         * This is the best answer.
@@ -8230,7 +8230,7 @@ query_nodata(query_ctx_t *qctx, isc_result_t res) {
                                return (ns_query_done(qctx));;
                        }
                }
-               dns_name_copy(qctx->client->query.qname, qctx->fname, NULL);
+               RUNTIME_CHECK(dns_name_copy(qctx->client->query.qname, qctx->fname, NULL) == ISC_R_SUCCESS);
                qctx->dns64 = false;
 #ifdef dns64_bis_return_excluded_addresses
                /*
@@ -8642,8 +8642,7 @@ query_redirect(query_ctx_t *qctx)  {
                SAVE(qctx->client->query.redirect.sigrdataset,
                     qctx->sigrdataset);
                qctx->client->query.redirect.result = DNS_R_NCACHENXDOMAIN;
-               dns_name_copy(qctx->fname, qctx->client->query.redirect.fname,
-                             NULL);
+               RUNTIME_CHECK(dns_name_copy(qctx->fname, qctx->client->query.redirect.fname, NULL) == ISC_R_SUCCESS);
                qctx->client->query.redirect.authoritative =
                        qctx->authoritative;
                qctx->client->query.redirect.is_zone = qctx->is_zone;
@@ -8753,7 +8752,7 @@ query_synthnodata(query_ctx_t *qctx, const dns_name_t *signer,
                goto cleanup;
        }
 
-       dns_name_copy(signer, name, NULL);
+       RUNTIME_CHECK(dns_name_copy(signer, name, NULL) == ISC_R_SUCCESS);
 
        /*
         * Add SOA record. Omit the RRSIG if DNSSEC was not requested.
@@ -8818,7 +8817,7 @@ query_synthwildcard(query_ctx_t *qctx, dns_rdataset_t *rdataset,
                result = ISC_R_NOMEMORY;
                goto cleanup;
        }
-       dns_name_copy(qctx->client->query.qname, name, NULL);
+       RUNTIME_CHECK(dns_name_copy(qctx->client->query.qname, name, NULL) == ISC_R_SUCCESS);
 
        cloneset = ns_client_newrdataset(qctx->client);
        if (cloneset == NULL) {
@@ -8980,7 +8979,7 @@ query_synthnxdomain(query_ctx_t *qctx,
                goto cleanup;
        }
 
-       dns_name_copy(signer, name, NULL);
+       RUNTIME_CHECK(dns_name_copy(signer, name, NULL) == ISC_R_SUCCESS);
 
        /*
         * Add SOA record. Omit the RRSIG if DNSSEC was not requested.
@@ -9011,7 +9010,7 @@ query_synthnxdomain(query_ctx_t *qctx,
                        goto cleanup;
                }
 
-               dns_name_copy(nowild, name, NULL);
+               RUNTIME_CHECK(dns_name_copy(nowild, name, NULL) == ISC_R_SUCCESS);
 
                cloneset = ns_client_newrdataset(qctx->client);
                clonesigset = ns_client_newrdataset(qctx->client);
@@ -9064,7 +9063,7 @@ checksignames(dns_name_t *signer, dns_rdataset_t *sigrdataset) {
                result = dns_rdata_tostruct(&rdata, &rrsig, NULL);
                RUNTIME_CHECK(result == ISC_R_SUCCESS);
                if (dns_name_countlabels(signer) == 0) {
-                       dns_name_copy(&rrsig.signer, signer, NULL);
+                       RUNTIME_CHECK(dns_name_copy(&rrsig.signer, signer, NULL) == ISC_R_SUCCESS);
                } else if (!dns_name_equal(signer, &rrsig.signer)) {
                        return (ISC_R_FAILURE);
                }
@@ -9481,8 +9480,7 @@ query_cname(query_ctx_t *qctx) {
            (qctx->fname->attributes & DNS_NAMEATTR_WILDCARD) != 0)
        {
                dns_fixedname_init(&qctx->wildcardname);
-               dns_name_copy(qctx->fname,
-                             dns_fixedname_name(&qctx->wildcardname), NULL);
+               RUNTIME_CHECK(dns_name_copy(qctx->fname, dns_fixedname_name(&qctx->wildcardname), NULL) == ISC_R_SUCCESS);
                qctx->need_wildcardproof = true;
        }
 
@@ -9594,8 +9592,7 @@ query_dname(query_ctx_t *qctx) {
            (qctx->fname->attributes & DNS_NAMEATTR_WILDCARD) != 0)
        {
                dns_fixedname_init(&qctx->wildcardname);
-               dns_name_copy(qctx->fname,
-                             dns_fixedname_name(&qctx->wildcardname), NULL);
+               RUNTIME_CHECK(dns_name_copy(qctx->fname, dns_fixedname_name(&qctx->wildcardname), NULL) == ISC_R_SUCCESS);
                qctx->need_wildcardproof = true;
        }
 
@@ -9787,8 +9784,7 @@ query_prepresponse(query_ctx_t *qctx) {
            (qctx->fname->attributes & DNS_NAMEATTR_WILDCARD) != 0)
        {
                dns_fixedname_init(&qctx->wildcardname);
-               dns_name_copy(qctx->fname,
-                             dns_fixedname_name(&qctx->wildcardname), NULL);
+               RUNTIME_CHECK(dns_name_copy(qctx->fname, dns_fixedname_name(&qctx->wildcardname), NULL) == ISC_R_SUCCESS);
                qctx->need_wildcardproof = true;
        }
 
@@ -10370,7 +10366,7 @@ query_addwildcardproof(query_ctx_t *qctx, bool ispositive,
                /*
                 * Find the closest encloser.
                 */
-               dns_name_copy(name, cname, NULL);
+               RUNTIME_CHECK(dns_name_copy(name, cname, NULL) == ISC_R_SUCCESS);
                while (result == DNS_R_NXDOMAIN) {
                        labels = dns_name_countlabels(cname) - 1;
                        /*
@@ -10423,7 +10419,7 @@ query_addwildcardproof(query_ctx_t *qctx, bool ispositive,
                 */
                labels = dns_name_countlabels(cname) + 1;
                if (dns_name_countlabels(name) == labels)
-                       dns_name_copy(name, wname, NULL);
+                       RUNTIME_CHECK(dns_name_copy(name, wname, NULL) == ISC_R_SUCCESS);
                else
                        dns_name_split(name, labels, NULL, wname);
 
index 2a3c7d244fa9f439929ccace3806e981aee242a1..049442ac9f52cdf52609f238b0d8c68d10287ca2 100644 (file)
@@ -708,7 +708,7 @@ foreach_rr(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
                add_rr_prepare_ctx_t *ctx = rr_action_data;
 
                ctx->oldname = dns_fixedname_initname(&fixed);
-               dns_name_copy(name, ctx->oldname, NULL);
+               RUNTIME_CHECK(dns_name_copy(name, ctx->oldname, NULL) == ISC_R_SUCCESS);
                dns_rdataset_getownercase(&rdataset, ctx->oldname);
        }
 
@@ -1042,7 +1042,7 @@ temp_check(isc_mem_t *mctx, dns_diff_t *temp, dns_db_t *db,
        t = ISC_LIST_HEAD(temp->tuples);
        while (t != NULL) {
                name = &t->name;
-               (void)dns_name_copy(name, tmpname, NULL);
+               RUNTIME_CHECK(dns_name_copy(name, tmpname, NULL) == ISC_R_SUCCESS);
                *typep = t->rdata.type;
 
                /* A new unique name begins here. */
index 2fb49b1b616976f1a9c36d535372e6d90a51e263..45d268a22df1cd9c9bdf4c831ad64e487688b1dc 100644 (file)
@@ -935,7 +935,7 @@ resolve_ns(isc_task_t *task, isc_event_t *event) {
                                ISC_LIST_APPEND(trans->nslist, pns, link);
                                ISC_LIST_INIT(pns->servers);
 
-                               dns_name_copy(&ns.name, pns->name, NULL);
+                               RUNTIME_CHECK(dns_name_copy(&ns.name, pns->name, NULL) == ISC_R_SUCCESS);
                                dns_rdata_reset(&rdata);
                                dns_rdata_freestruct(&ns);
                        }