2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 10:10:06 +00:00

Apply the SET_IF_NOT_NULL() semantic patch

spatch --sp-file cocci/set_if_not_null.spatch --use-gitgrep --dir "." --include-headers --in-place
This commit is contained in:
Tony Finch 2023-04-06 16:32:16 +01:00 committed by Ondřej Surý
parent 0d6dcd217d
commit c622b349e4
No known key found for this signature in database
GPG Key ID: 2820F37E873DEA41
28 changed files with 69 additions and 205 deletions

View File

@ -4543,9 +4543,7 @@ getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp) {
result = isc_getaddresses(host, 0, sockaddrs, DIG_MAX_ADDRESSES, result = isc_getaddresses(host, 0, sockaddrs, DIG_MAX_ADDRESSES,
&count); &count);
isc_loopmgr_nonblocking(loopmgr); isc_loopmgr_nonblocking(loopmgr);
if (resultp != NULL) { SET_IF_NOT_NULL(resultp, result);
*resultp = result;
}
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
if (resultp == NULL) { if (resultp == NULL) {
fatal("couldn't get address for '%s': %s", host, fatal("couldn't get address for '%s': %s", host,

View File

@ -291,15 +291,11 @@ strtotime(const char *str, int64_t now, int64_t base, bool *setp) {
struct tm tm; struct tm tm;
if (isnone(str)) { if (isnone(str)) {
if (setp != NULL) { SET_IF_NOT_NULL(setp, false);
*setp = false;
}
return ((isc_stdtime_t)0); return ((isc_stdtime_t)0);
} }
if (setp != NULL) { SET_IF_NOT_NULL(setp, true);
*setp = true;
}
if ((str[0] == '0' || str[0] == '-') && str[1] == '\0') { if ((str[0] == '0' || str[0] == '-') && str[1] == '\0') {
return ((isc_stdtime_t)0); return ((isc_stdtime_t)0);

View File

@ -952,11 +952,7 @@ named_config_getkeyalgorithm(const char *str, unsigned int *typep,
} else { } else {
bits = algorithms[i].size; bits = algorithms[i].size;
} }
if (typep != NULL) { SET_IF_NOT_NULL(typep, algorithms[i].type);
*typep = algorithms[i].type; SET_IF_NOT_NULL(digestbits, bits);
}
if (digestbits != NULL) {
*digestbits = bits;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@ -270,9 +270,7 @@ pack_soa_record(unsigned char *rdatap, size_t rbufsz, size_t *rdlenp,
rdatap += 4; rdatap += 4;
used += (4 * 5); used += (4 * 5);
if (rdlenp != NULL) { SET_IF_NOT_NULL(rdlenp, used);
*rdlenp = used;
}
return (true); return (true);
} }
@ -1889,9 +1887,7 @@ domain_pton2(const char *src, u_char *dst, size_t dstsiz, size_t *dstlen,
tptr = tmps; tptr = tmps;
if (dstlen != NULL) { SET_IF_NOT_NULL(dstlen, 0);
*dstlen = 0;
}
while (tptr && *tptr) { while (tptr && *tptr) {
tok = strsep(&tptr, "."); tok = strsep(&tptr, ".");
@ -2117,9 +2113,7 @@ trpz_rsp_rr(librpz_emsg_t *emsg, uint16_t *typep, uint16_t *classp,
*ttlp = 3600; *ttlp = 3600;
} }
if (typep != NULL) { SET_IF_NOT_NULL(typep, this_rr->type);
*typep = this_rr->type;
}
if (rrp != NULL) { if (rrp != NULL) {
uint8_t *copy_src = NULL, *nrdata = NULL; uint8_t *copy_src = NULL, *nrdata = NULL;
@ -2205,9 +2199,7 @@ trpz_rsp_rr(librpz_emsg_t *emsg, uint16_t *typep, uint16_t *classp,
trsp->rstack[0].result.next_rr = this_rr->rrn; trsp->rstack[0].result.next_rr = this_rr->rrn;
last_result->rridx++; last_result->rridx++;
} else { } else {
if (typep != NULL) { SET_IF_NOT_NULL(typep, ns_t_invalid);
*typep = ns_t_invalid;
}
if (rrp != NULL) { if (rrp != NULL) {
*rrp = NULL; *rrp = NULL;

View File

@ -1114,9 +1114,7 @@ sanity_check_data_file(const char *fname, char **errp) {
FILE *f = NULL; FILE *f = NULL;
int result = -1; int result = -1;
if (errp != NULL) { SET_IF_NOT_NULL(errp, NULL);
*errp = NULL;
}
f = fopen(fname, "r"); f = fopen(fname, "r");
if (f == NULL) { if (f == NULL) {

View File

@ -3691,25 +3691,15 @@ dns_adb_getquota(dns_adb_t *adb, uint32_t *quotap, uint32_t *freqp,
double *lowp, double *highp, double *discountp) { double *lowp, double *highp, double *discountp) {
REQUIRE(DNS_ADB_VALID(adb)); REQUIRE(DNS_ADB_VALID(adb));
if (quotap != NULL) { SET_IF_NOT_NULL(quotap, adb->quota);
*quotap = adb->quota;
}
if (freqp != NULL) { SET_IF_NOT_NULL(freqp, adb->atr_freq);
*freqp = adb->atr_freq;
}
if (lowp != NULL) { SET_IF_NOT_NULL(lowp, adb->atr_low);
*lowp = adb->atr_low;
}
if (highp != NULL) { SET_IF_NOT_NULL(highp, adb->atr_high);
*highp = adb->atr_high;
}
if (discountp != NULL) { SET_IF_NOT_NULL(discountp, adb->atr_discount);
*discountp = adb->atr_discount;
}
} }
static bool static bool

View File

@ -212,12 +212,8 @@ dst_key_have_ksk_and_zsk(dst_key_t **keys, unsigned int nkeys, unsigned int i,
} }
} }
if (have_ksk != NULL) { SET_IF_NOT_NULL(have_ksk, hksk);
*have_ksk = hksk; SET_IF_NOT_NULL(have_zsk, hzsk);
}
if (have_zsk != NULL) {
*have_zsk = hzsk;
}
return (hksk && hzsk); return (hksk && hzsk);
} }

View File

@ -2633,12 +2633,8 @@ dns_message_peekheader(isc_buffer_t *source, dns_messageid_t *idp,
flags = isc_buffer_getuint16(&buffer); flags = isc_buffer_getuint16(&buffer);
flags &= DNS_MESSAGE_FLAG_MASK; flags &= DNS_MESSAGE_FLAG_MASK;
if (flagsp != NULL) { SET_IF_NOT_NULL(flagsp, flags);
*flagsp = flags; SET_IF_NOT_NULL(idp, id);
}
if (idp != NULL) {
*idp = id;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
@ -2786,9 +2782,7 @@ dns_message_gettsig(dns_message_t *msg, const dns_name_t **owner) {
REQUIRE(DNS_MESSAGE_VALID(msg)); REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(owner == NULL || *owner == NULL); REQUIRE(owner == NULL || *owner == NULL);
if (owner != NULL) { SET_IF_NOT_NULL(owner, msg->tsigname);
*owner = msg->tsigname;
}
return (msg->tsig); return (msg->tsig);
} }

View File

@ -271,9 +271,7 @@ dns_nsec3_hashname(dns_fixedname_t *result,
return (DNS_R_BADALG); return (DNS_R_BADALG);
} }
if (hash_length != NULL) { SET_IF_NOT_NULL(hash_length, len);
*hash_length = len;
}
/* convert the hash to base32hex non-padded */ /* convert the hash to base32hex non-padded */
region.base = rethash; region.base = rethash;

View File

@ -98,39 +98,23 @@ RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) {
void void
RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e,
const BIGNUM **d) { const BIGNUM **d) {
if (n != NULL) { SET_IF_NOT_NULL(n, r->n);
*n = r->n; SET_IF_NOT_NULL(e, r->e);
} SET_IF_NOT_NULL(d, r->d);
if (e != NULL) {
*e = r->e;
}
if (d != NULL) {
*d = r->d;
}
} }
void void
RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) { RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) {
if (p != NULL) { SET_IF_NOT_NULL(p, r->p);
*p = r->p; SET_IF_NOT_NULL(q, r->q);
}
if (q != NULL) {
*q = r->q;
}
} }
void void
RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1,
const BIGNUM **iqmp) { const BIGNUM **iqmp) {
if (dmp1 != NULL) { SET_IF_NOT_NULL(dmp1, r->dmp1);
*dmp1 = r->dmp1; SET_IF_NOT_NULL(dmq1, r->dmq1);
} SET_IF_NOT_NULL(iqmp, r->iqmp);
if (dmq1 != NULL) {
*dmq1 = r->dmq1;
}
if (iqmp != NULL) {
*iqmp = r->iqmp;
}
} }
int int
@ -143,12 +127,8 @@ RSA_test_flags(const RSA *r, int flags) {
/* From OpenSSL 1.1 */ /* From OpenSSL 1.1 */
void void
ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) { ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) {
if (pr != NULL) { SET_IF_NOT_NULL(pr, sig->r);
*pr = sig->r; SET_IF_NOT_NULL(ps, sig->s);
}
if (ps != NULL) {
*ps = sig->s;
}
} }
int int
@ -172,9 +152,7 @@ static const char err_empty_string = '\0';
unsigned long unsigned long
ERR_get_error_all(const char **file, int *line, const char **func, ERR_get_error_all(const char **file, int *line, const char **func,
const char **data, int *flags) { const char **data, int *flags) {
if (func != NULL) { SET_IF_NOT_NULL(func, &err_empty_string);
*func = &err_empty_string;
}
return (ERR_get_error_line_data(file, line, data, flags)); return (ERR_get_error_line_data(file, line, data, flags));
} }
#endif /* if !HAVE_ERR_GET_ERROR_ALL */ #endif /* if !HAVE_ERR_GET_ERROR_ALL */

View File

@ -1956,13 +1956,9 @@ getsize(dns_db_t *db, dns_dbversion_t *version, uint64_t *records,
} }
RWLOCK(&rbtversion->rwlock, isc_rwlocktype_read); RWLOCK(&rbtversion->rwlock, isc_rwlocktype_read);
if (records != NULL) { SET_IF_NOT_NULL(records, rbtversion->records);
*records = rbtversion->records;
}
if (xfrsize != NULL) { SET_IF_NOT_NULL(xfrsize, rbtversion->xfrsize);
*xfrsize = rbtversion->xfrsize;
}
RWUNLOCK(&rbtversion->rwlock, isc_rwlocktype_read); RWUNLOCK(&rbtversion->rwlock, isc_rwlocktype_read);
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read); RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);

View File

@ -247,9 +247,7 @@ finish:
isc_textregion_consume(region, 1); isc_textregion_consume(region, 1);
} }
RETERR(uint16_tobuffer(ul, target)); RETERR(uint16_tobuffer(ul, target));
if (value != NULL) { SET_IF_NOT_NULL(value, ul);
*value = ul;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@ -6854,9 +6854,7 @@ is_answertarget_allowed(fetchctx_t *fctx, dns_name_t *qname, dns_name_t *rname,
result = dns_name_concatenate(&prefix, &dname.dname, tname, result = dns_name_concatenate(&prefix, &dname.dname, tname,
NULL); NULL);
if (result == DNS_R_NAMETOOLONG) { if (result == DNS_R_NAMETOOLONG) {
if (chainingp != NULL) { SET_IF_NOT_NULL(chainingp, true);
*chainingp = true;
}
return (true); return (true);
} }
RUNTIME_CHECK(result == ISC_R_SUCCESS); RUNTIME_CHECK(result == ISC_R_SUCCESS);
@ -6865,9 +6863,7 @@ is_answertarget_allowed(fetchctx_t *fctx, dns_name_t *qname, dns_name_t *rname,
UNREACHABLE(); UNREACHABLE();
} }
if (chainingp != NULL) { SET_IF_NOT_NULL(chainingp, true);
*chainingp = true;
}
if (view->denyanswernames == NULL) { if (view->denyanswernames == NULL) {
return (true); return (true);
@ -11014,15 +11010,9 @@ dns_resolver_getclientsperquery(dns_resolver_t *resolver, uint32_t *cur,
REQUIRE(VALID_RESOLVER(resolver)); REQUIRE(VALID_RESOLVER(resolver));
LOCK(&resolver->lock); LOCK(&resolver->lock);
if (cur != NULL) { SET_IF_NOT_NULL(cur, resolver->spillat);
*cur = resolver->spillat; SET_IF_NOT_NULL(min, resolver->spillatmin);
} SET_IF_NOT_NULL(max, resolver->spillatmax);
if (min != NULL) {
*min = resolver->spillatmin;
}
if (max != NULL) {
*max = resolver->spillatmax;
}
UNLOCK(&resolver->lock); UNLOCK(&resolver->lock);
} }

View File

@ -210,11 +210,7 @@ dns_rriterator_current(dns_rriterator_t *it, dns_name_t **name, uint32_t *ttl,
dns_rdata_reset(&it->rdata); dns_rdata_reset(&it->rdata);
dns_rdataset_current(&it->rdataset, &it->rdata); dns_rdataset_current(&it->rdataset, &it->rdata);
if (rdataset != NULL) { SET_IF_NOT_NULL(rdataset, &it->rdataset);
*rdataset = &it->rdataset;
}
if (rdata != NULL) { SET_IF_NOT_NULL(rdata, &it->rdata);
*rdata = &it->rdata;
}
} }

View File

@ -290,9 +290,7 @@ dns_tsigkey_createfromkey(const dns_name_t *name, dst_algorithm_t algorithm,
tsig_log(tkey, ISC_LOG_DEBUG(3), "statically configured"); tsig_log(tkey, ISC_LOG_DEBUG(3), "statically configured");
} }
if (keyp != NULL) { SET_IF_NOT_NULL(keyp, tkey);
*keyp = tkey;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
cleanup_name: cleanup_name:

View File

@ -851,9 +851,7 @@ is_active(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, bool *flag,
if (result == ISC_R_SUCCESS || result == DNS_R_EMPTYNAME) { if (result == ISC_R_SUCCESS || result == DNS_R_EMPTYNAME) {
*flag = true; *flag = true;
*cut = false; *cut = false;
if (unsecure != NULL) { SET_IF_NOT_NULL(unsecure, false);
*unsecure = false;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} else if (result == DNS_R_ZONECUT) { } else if (result == DNS_R_ZONECUT) {
*flag = true; *flag = true;
@ -879,9 +877,7 @@ is_active(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, bool *flag,
{ {
*flag = false; *flag = false;
*cut = false; *cut = false;
if (unsecure != NULL) { SET_IF_NOT_NULL(unsecure, false);
*unsecure = false;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} else { } else {
/* /*
@ -889,9 +885,7 @@ is_active(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, bool *flag,
*/ */
*flag = false; *flag = false;
*cut = false; *cut = false;
if (unsecure != NULL) { SET_IF_NOT_NULL(unsecure, false);
*unsecure = false;
}
return (result); return (result);
} }
} }
@ -2231,9 +2225,7 @@ dns_update_soaserial(uint32_t serial, dns_updatemethod_t method,
UNREACHABLE(); UNREACHABLE();
} }
if (used != NULL) { SET_IF_NOT_NULL(used, method);
*used = method;
}
return (new_serial); return (new_serial);
} }

View File

@ -125,7 +125,7 @@
*/ */
#define RANGE(a, min, max) (((a) < (min)) ? (min) : ((a) < (max) ? (a) : (max))) #define RANGE(a, min, max) (((a) < (min)) ? (min) : ((a) < (max) ? (a) : (max)))
#define NSEC3REMOVE(x) (((x) & DNS_NSEC3FLAG_REMOVE) != 0) #define NSEC3REMOVE(x) (((x)&DNS_NSEC3FLAG_REMOVE) != 0)
/*% /*%
* Key flags * Key flags
@ -5459,12 +5459,8 @@ zone_count_ns_rr(dns_zone_t *zone, dns_db_t *db, dns_dbnode_t *node,
dns_rdataset_disassociate(&rdataset); dns_rdataset_disassociate(&rdataset);
success: success:
if (nscount != NULL) { SET_IF_NOT_NULL(nscount, count);
*nscount = count; SET_IF_NOT_NULL(errors, ecount);
}
if (errors != NULL) {
*errors = ecount;
}
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;

View File

@ -527,9 +527,7 @@ dns_zt_apply(dns_zt_t *zt, bool stop, isc_result_t *sub,
} }
dns_qpread_destroy(zt->multi, &qpr); dns_qpread_destroy(zt->multi, &qpr);
if (sub != NULL) { SET_IF_NOT_NULL(sub, tresult);
*sub = tresult;
}
return (result); return (result);
} }

View File

@ -347,9 +347,7 @@ isc_hashmap_find(const isc_hashmap_t *hashmap, const uint32_t *hashvalp,
} }
INSIST(node->key != NULL); INSIST(node->key != NULL);
if (valuep != NULL) { SET_IF_NOT_NULL(valuep, node->value);
*valuep = node->value;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@ -372,9 +372,7 @@ isc_ht_find(const isc_ht_t *ht, const unsigned char *key,
return (ISC_R_NOTFOUND); return (ISC_R_NOTFOUND);
} }
if (valuep != NULL) { SET_IF_NOT_NULL(valuep, node->value);
*valuep = node->value;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@ -844,9 +844,7 @@ isc_buffer_peekuint8(const isc_buffer_t *restrict b, uint8_t *valp) {
ISC_BUFFER_PEEK_CHECK(b, sizeof(*valp)); ISC_BUFFER_PEEK_CHECK(b, sizeof(*valp));
uint8_t *cp = isc_buffer_current(b); uint8_t *cp = isc_buffer_current(b);
if (valp != NULL) { SET_IF_NOT_NULL(valp, (uint8_t)(cp[0]));
*valp = (uint8_t)(cp[0]);
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
@ -887,9 +885,7 @@ isc_buffer_peekuint16(const isc_buffer_t *restrict b, uint16_t *valp) {
uint8_t *cp = isc_buffer_current(b); uint8_t *cp = isc_buffer_current(b);
if (valp != NULL) { SET_IF_NOT_NULL(valp, ISC_U8TO16_BE(cp));
*valp = ISC_U8TO16_BE(cp);
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
@ -917,9 +913,7 @@ isc_buffer_peekuint32(const isc_buffer_t *restrict b, uint32_t *valp) {
uint8_t *cp = isc_buffer_current(b); uint8_t *cp = isc_buffer_current(b);
if (valp != NULL) { SET_IF_NOT_NULL(valp, ISC_U8TO32_BE(cp));
*valp = ISC_U8TO32_BE(cp);
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
@ -948,9 +942,7 @@ isc_buffer_peekuint48(const isc_buffer_t *restrict b, uint64_t *valp) {
uint8_t *cp = isc_buffer_current(b); uint8_t *cp = isc_buffer_current(b);
if (valp != NULL) { SET_IF_NOT_NULL(valp, ISC_U8TO48_BE(cp));
*valp = ISC_U8TO48_BE(cp);
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@ -288,9 +288,7 @@ isc_log_create(isc_mem_t *mctx, isc_log_t **lctxp, isc_logconfig_t **lcfgp) {
atomic_init(&lctx->dynamic, lcfg->dynamic); atomic_init(&lctx->dynamic, lcfg->dynamic);
*lctxp = lctx; *lctxp = lctx;
if (lcfgp != NULL) { SET_IF_NOT_NULL(lcfgp, lcfg);
*lcfgp = lcfg;
}
} }
void void

View File

@ -384,21 +384,13 @@ isc_nm_gettimeouts(isc_nm_t *mgr, uint32_t *initial, uint32_t *idle,
uint32_t *keepalive, uint32_t *advertised) { uint32_t *keepalive, uint32_t *advertised) {
REQUIRE(VALID_NM(mgr)); REQUIRE(VALID_NM(mgr));
if (initial != NULL) { SET_IF_NOT_NULL(initial, atomic_load_relaxed(&mgr->init));
*initial = atomic_load_relaxed(&mgr->init);
}
if (idle != NULL) { SET_IF_NOT_NULL(idle, atomic_load_relaxed(&mgr->idle));
*idle = atomic_load_relaxed(&mgr->idle);
}
if (keepalive != NULL) { SET_IF_NOT_NULL(keepalive, atomic_load_relaxed(&mgr->keepalive));
*keepalive = atomic_load_relaxed(&mgr->keepalive);
}
if (advertised != NULL) { SET_IF_NOT_NULL(advertised, atomic_load_relaxed(&mgr->advertised));
*advertised = atomic_load_relaxed(&mgr->advertised);
}
} }
bool bool

View File

@ -85,9 +85,7 @@ isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) {
result = isc__errno2result(errno); result = isc__errno2result(errno);
} }
} }
if (nret != NULL) { SET_IF_NOT_NULL(nret, r);
*nret = r;
}
return (result); return (result);
} }
@ -102,9 +100,7 @@ isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f,
if (r != nmemb) { if (r != nmemb) {
result = isc__errno2result(errno); result = isc__errno2result(errno);
} }
if (nret != NULL) { SET_IF_NOT_NULL(nret, r);
*nret = r;
}
return (result); return (result);
} }

View File

@ -161,9 +161,7 @@ isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type,
return (ISC_R_NOTFOUND); return (ISC_R_NOTFOUND);
} }
if (value != NULL) { SET_IF_NOT_NULL(value, elt->value);
*value = elt->value;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@ -198,9 +198,7 @@ isccc_symtab_lookup(isccc_symtab_t *symtab, const char *key, unsigned int type,
return (ISC_R_NOTFOUND); return (ISC_R_NOTFOUND);
} }
if (value != NULL) { SET_IF_NOT_NULL(value, elt->value);
*value = elt->value;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@ -1144,9 +1144,7 @@ check_port(const cfg_obj_t *options, isc_log_t *logctx, const char *type,
return (ISC_R_RANGE); return (ISC_R_RANGE);
} }
if (portp != NULL) { SET_IF_NOT_NULL(portp, (in_port_t)cfg_obj_asuint32(portobj));
*portp = (in_port_t)cfg_obj_asuint32(portobj);
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@ -1092,9 +1092,7 @@ query_validatezonedb(ns_client_t *client, const dns_name_t *name,
approved: approved:
/* Transfer ownership, if necessary. */ /* Transfer ownership, if necessary. */
if (versionp != NULL) { SET_IF_NOT_NULL(versionp, dbversion->version);
*versionp = dbversion->version;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
@ -1495,9 +1493,7 @@ query_isduplicate(ns_client_t *client, dns_name_t *name, dns_rdatatype_t type,
mname = NULL; mname = NULL;
} }
if (mnamep != NULL) { SET_IF_NOT_NULL(mnamep, mname);
*mnamep = mname;
}
CTRACE(ISC_LOG_DEBUG(3), "query_isduplicate: false: done"); CTRACE(ISC_LOG_DEBUG(3), "query_isduplicate: false: done");
return (false); return (false);