]> 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>
Tue, 1 Oct 2019 00:43:26 +0000 (10:43 +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.

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 3751d799d9c6dda4765de070eec4fb05cec35311..ca2cc977576d37e808d6287dd72aa419c2c92641 100644 (file)
@@ -836,8 +836,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,
@@ -1842,7 +1841,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 5942fd159bd758d0fb23250a0225991dec6c324b..7b53e8e3be313200e209d277b3d3608807b0ff3f 100644 (file)
@@ -394,7 +394,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);
        }
 }
@@ -456,7 +456,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf,
 
                /* 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 6d2d073864c61bb5b9a42c3f00f0f261b73aa14a..db0da0174f9af5d7d2b89a567b6072e02c349516 100644 (file)
@@ -423,7 +423,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);
        }
 }
@@ -481,7 +481,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf,
 
                /* 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 005e7fe81061fc9f30fb7435624f7724fb6cf817..e8858dc681000f24d3c226a5e932748cdd95265f 100644 (file)
@@ -197,7 +197,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);
 }
@@ -2325,7 +2325,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",
@@ -2459,7 +2459,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 f403095e6b22223371f338c7b1dd6edde159a651..1881da28322fcfeaf35394bde916814083e80755 100644 (file)
@@ -2618,7 +2618,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 1912f2a2fd26b342d2e079c921ef632ecc74d419..cddebbefcdc212b78af8d8be2a7b49ee928b3726 100644 (file)
@@ -130,7 +130,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 8e1cb714b93026b5db957c5c2f0bd0877e83ef7c..361bfeaea4ff29189fdf479576faba60ab0f46e4 100644 (file)
@@ -521,7 +521,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);
        }
 
@@ -1215,7 +1215,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 be6949b4072dbe31b4a62af09a7a013d213f56b4..aa2a3fc67a509d9bd70b7aebaf5276d8277e07f7 100644 (file)
@@ -1926,7 +1926,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);
@@ -2069,7 +2069,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));
@@ -2100,7 +2100,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 428a40d3191f7dafda4dc404e169292abf2418a9..809ab3841de4bf514ff839435f2cd8ae64380241 100644 (file)
@@ -310,7 +310,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 d7d65c047bb8b4d493b7511aa8f27a44e48e1e9f..47d198ec14366f566bed5e678010b149b4870b9f 100644 (file)
@@ -5075,7 +5075,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.
@@ -9315,7 +9315,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
@@ -9684,7 +9685,7 @@ glue_nsdname_cb(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
                glue = isc_mem_get(ctx->rbtdb->common.mctx, sizeof(*glue));
 
                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);
@@ -9708,7 +9709,7 @@ glue_nsdname_cb(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
                                           sizeof(*glue));
 
                        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 629d6fc979bc8a9e991310845eebcc4f33d5d98d..5aaf1ddce4e5250945da6a0e29d1e66ed8cbbc4e 100644 (file)
@@ -454,7 +454,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 bb33c987b72755146d5304148adb61654568b989..3b0bea495b1ffad6eea4d9093a9a77a042cf5eb5 100644 (file)
@@ -1519,7 +1519,7 @@ fcount_incr(fetchctx_t *fctx, bool force) {
                        counter->allowed = 1;
                        counter->dropped = 0;
                        counter->domain = dns_fixedname_initname(&counter->fdname);
-                       dns_name_copy(&fctx->domain, counter->domain, NULL);
+                       RUNTIME_CHECK(dns_name_copy(&fctx->domain, counter->domain, NULL) == ISC_R_SUCCESS);
                        ISC_LIST_APPEND(dbucket->list, counter, link);
                }
        } else {
@@ -5345,8 +5345,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));
@@ -7080,7 +7079,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 b1b5ac037a2a4e84ac9c09ddadef3f8667109802..55fb3dcc0dff8c827d865a40d629fcca56c10efb 100644 (file)
@@ -885,9 +885,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 e7683a79184e9961cdb31b60370923e9cb4d3954..019d50f5e99bb06b95bdb5424615c06741358797 100644 (file)
@@ -1544,8 +1544,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);
 }
 
@@ -1558,7 +1560,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 9b123219299a079fa50c9150ecd5ca1d2864a96f..69d9096cc3b09a72d53153138ed0315099eb7d28 100644 (file)
@@ -1389,8 +1389,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);
 }
 
@@ -1403,7 +1405,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 965d6d52d66e62ea7ab190dabc9746c37a4a58a0..26a6fb8429329065872b4bb3b0e8977d165cb8d6 100644 (file)
@@ -1497,7 +1497,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 3aa919483e12083eb7eb57273a40c71b4b79e62c..3c5b99ce798e4ab6bc039b05c8ee8f96b2144059 100644 (file)
@@ -1394,7 +1394,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;
@@ -2241,7 +2241,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 {
@@ -2634,7 +2634,7 @@ proveunsecure(dns_validator_t *val, bool have_ds, bool resume) {
 
        secroot = dns_fixedname_initname(&fixedsecroot);
        found = dns_fixedname_initname(&fixedfound);
-       dns_name_copy(val->event->name, secroot, NULL);
+       RUNTIME_CHECK(dns_name_copy(val->event->name, secroot, NULL) == ISC_R_SUCCESS);
        /*
         * If this is a response to a DS query, we need to look in
         * the parent zone for the trust anchor.
@@ -2705,7 +2705,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 ce2ca2e096876757a1a3e93ac39545122313fa5e..2712df9e3d11a9783bfeeae1a09071e5de171c82 100644 (file)
@@ -1384,7 +1384,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 669db74b75cf065a8b1c5fb72e87bdc7fdf82274..14b46faa6660b3be3e37f09e1b10436787e95a29 100644 (file)
@@ -3051,7 +3051,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) {
@@ -3074,7 +3074,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);
                }
 
@@ -7858,7 +7858,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;
                        }
@@ -8121,7 +8121,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;
                        }
@@ -8843,7 +8843,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 eb5aedc196bef2d488d30436efe2418903b5adef..cd8f5692b899e6431f1ff50098cdc26fb04e9195 100644 (file)
@@ -1777,11 +1777,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);
@@ -1862,7 +1862,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 ce5d6374a163897f9c361a8e67e017be5d1a7fba..6b04182411803abab0948f8ec943843cd87c9a97 100644 (file)
@@ -2838,7 +2838,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) {
@@ -3100,7 +3100,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);
@@ -4599,7 +4599,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;
 }
 
@@ -4788,7 +4788,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)) {
@@ -4888,7 +4888,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;
@@ -4958,7 +4958,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)) {
@@ -6356,7 +6356,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);
@@ -7787,7 +7787,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.
@@ -8240,7 +8240,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
                /*
@@ -8652,8 +8652,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;
@@ -8763,7 +8762,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.
@@ -8828,7 +8827,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) {
@@ -8990,7 +8989,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.
@@ -9021,7 +9020,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);
@@ -9074,7 +9073,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);
                }
@@ -9491,8 +9490,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;
        }
 
@@ -9604,8 +9602,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;
        }
 
@@ -9797,8 +9794,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;
        }
 
@@ -10380,7 +10376,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;
                        /*
@@ -10433,7 +10429,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 738a9d828a04219f6b5db249b29839750aded283..228870023f7d047ff41958c2175ccad63f49df72 100644 (file)
@@ -706,7 +706,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);
        }
 
@@ -1040,7 +1040,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 0ca51dd7182e4b20456d37d90a46545e1d3a30f3..ecf396fc1215a62e30534aa176983c67efde7156 100644 (file)
@@ -911,7 +911,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);
                        }