mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
Apply more SET_IF_NOT_NULL() changes
coccinelle v1.2 found more cases where the SET_IF_NOT_NULL macro applies.
This commit is contained in:
parent
f4377a3cd6
commit
57b64dc397
@ -460,9 +460,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
||||
dns_secalg_t alg;
|
||||
isc_stdtime_t now = isc_stdtime_now();
|
||||
|
||||
if (exact != NULL) {
|
||||
*exact = false;
|
||||
}
|
||||
SET_IF_NOT_NULL(exact, false);
|
||||
|
||||
id = dst_key_id(dstkey);
|
||||
rid = dst_key_rid(dstkey);
|
||||
|
@ -2551,9 +2551,7 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
|
||||
return result;
|
||||
}
|
||||
|
||||
if (name != NULL) {
|
||||
*name = foundname;
|
||||
}
|
||||
SET_IF_NOT_NULL(name, foundname);
|
||||
|
||||
/*
|
||||
* And now look for the type.
|
||||
|
@ -138,12 +138,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
||||
if (dns_rdataset_isassociated(&nsecset) &&
|
||||
dns_rdataset_isassociated(&nsec3paramset))
|
||||
{
|
||||
if (build_nsec != NULL) {
|
||||
*build_nsec = true;
|
||||
}
|
||||
if (build_nsec3 != NULL) {
|
||||
*build_nsec3 = true;
|
||||
}
|
||||
SET_IF_NOT_NULL(build_nsec, true);
|
||||
SET_IF_NOT_NULL(build_nsec3, true);
|
||||
goto success;
|
||||
}
|
||||
|
||||
@ -160,12 +156,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
||||
* Look to see if we also need to be creating a NSEC3 chain.
|
||||
*/
|
||||
if (dns_rdataset_isassociated(&nsecset)) {
|
||||
if (build_nsec != NULL) {
|
||||
*build_nsec = true;
|
||||
}
|
||||
if (build_nsec3 != NULL) {
|
||||
*build_nsec3 = false;
|
||||
}
|
||||
SET_IF_NOT_NULL(build_nsec, true);
|
||||
SET_IF_NOT_NULL(build_nsec3, false);
|
||||
if (!dns_rdataset_isassociated(&privateset)) {
|
||||
goto success;
|
||||
}
|
||||
@ -194,12 +186,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
||||
}
|
||||
|
||||
if (dns_rdataset_isassociated(&nsec3paramset)) {
|
||||
if (build_nsec3 != NULL) {
|
||||
*build_nsec3 = true;
|
||||
}
|
||||
if (build_nsec != NULL) {
|
||||
*build_nsec = false;
|
||||
}
|
||||
SET_IF_NOT_NULL(build_nsec3, true);
|
||||
SET_IF_NOT_NULL(build_nsec, false);
|
||||
if (!dns_rdataset_isassociated(&privateset)) {
|
||||
goto success;
|
||||
}
|
||||
@ -264,12 +252,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
||||
goto success;
|
||||
}
|
||||
|
||||
if (build_nsec != NULL) {
|
||||
*build_nsec = false;
|
||||
}
|
||||
if (build_nsec3 != NULL) {
|
||||
*build_nsec3 = false;
|
||||
}
|
||||
SET_IF_NOT_NULL(build_nsec, false);
|
||||
SET_IF_NOT_NULL(build_nsec3, false);
|
||||
if (!dns_rdataset_isassociated(&privateset)) {
|
||||
goto success;
|
||||
}
|
||||
|
@ -1599,9 +1599,7 @@ dns_view_issecuredomain(dns_view_t *view, const dns_name_t *name,
|
||||
return result;
|
||||
}
|
||||
|
||||
if (ntap != NULL) {
|
||||
*ntap = false;
|
||||
}
|
||||
SET_IF_NOT_NULL(ntap, false);
|
||||
if (checknta && secure && view->ntatable_priv != NULL &&
|
||||
dns_ntatable_covered(view->ntatable_priv, now, name, anchor))
|
||||
{
|
||||
|
@ -209,9 +209,7 @@ count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
|
||||
REQUIRE(count != NULL);
|
||||
|
||||
if (has_negative != NULL) {
|
||||
*has_negative = false;
|
||||
}
|
||||
SET_IF_NOT_NULL(has_negative, false);
|
||||
|
||||
for (elt = cfg_list_first(caml); elt != NULL; elt = cfg_list_next(elt))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user