listcount = newlen;
}
/* Seen? */
- for (j = 0; j < l; j++)
- if (strcasecmp(lists[j].name, listname) == 0)
+ for (j = 0; j < l; j++) {
+ if (strcasecmp(lists[j].name, listname) == 0) {
break;
+ }
+ }
if (j < l)
continue;
tresult = named_config_getmastersdef(config, listname,
isc_result_t result = ISC_R_SUCCESS;
for (listener = ISC_LIST_HEAD(cp->listeners); listener != NULL;
- listener = ISC_LIST_NEXT(listener, link))
- if (isc_sockaddr_equal(addr, &listener->address))
+ listener = ISC_LIST_NEXT(listener, link)) {
+ if (isc_sockaddr_equal(addr, &listener->address)) {
break;
+ }
+ }
+
if (listener == NULL) {
*listenerp = NULL;
return;
/*
* Check that all the arguments match.
*/
- for (i = 0; i < dbtypec; i++)
- if (argv[i] == NULL || strcmp(argv[i], dbargv[i]) != 0)
+ for (i = 0; i < dbtypec; i++) {
+ if (argv[i] == NULL || strcmp(argv[i], dbargv[i]) != 0) {
CHECK(ISC_R_FAILURE);
+ /*
+ * Check that there are not extra arguments.
+ */
+ }
+ }
+
/*
* Check that there are not extra arguments.
*/
* Prevent duplicate views.
*/
for (vle = ISC_LIST_HEAD(dctx->viewlist); vle != NULL;
- vle = ISC_LIST_NEXT(vle, link))
- if (vle->view == view)
+ vle = ISC_LIST_NEXT(vle, link)) {
+ if (vle->view == view) {
return (ISC_R_SUCCESS);
+ }
+ }
+
vle = isc_mem_get(dctx->mctx, sizeof *vle);
vle->view = NULL;
dns_view_attach(view, &vle->view);
isc_result_t result = ISC_R_SUCCESS;
for (listener = ISC_LIST_HEAD(server->statschannels); listener != NULL;
- listener = ISC_LIST_NEXT(listener, link))
- if (isc_sockaddr_equal(addr, &listener->address))
+ listener = ISC_LIST_NEXT(listener, link)) {
+ if (isc_sockaddr_equal(addr, &listener->address)) {
break;
+ }
+ }
+
if (listener == NULL) {
*listenerp = NULL;
return;
if (verbose && dbi != NULL) {
if (dbi->wversion != NULL)
printf("future version (%p)\n", dbi->wversion);
- for (i = 0; i < dbi->rcount; i++)
- if (dbi->rversions[i] != NULL)
+ for (i = 0; i < dbi->rcount; i++) {
+ if (dbi->rversions[i] != NULL) {
printf("open version %d (%p)\n", i,
dbi->rversions[i]);
+ }
+ }
}
dns_name_init(&name, offsets);
if (strcmp(s, "!R") == 0) {
REQUIRE(startField > 0 && startField <= endField);
/* determine how large the data is */
- for (i = startField; i <= endField; i++)
- if (sqlOK(SQLColAttribute(stmnt, i, SQL_DESC_DISPLAY_SIZE, NULL,
- 0, NULL, &size)) &&
- size > 0) {
+ for (i = startField; i <= endField; i++) {
+ if (sqlOK(SQLColAttribute(stmnt, i, SQL_DESC_DISPLAY_SIZE, NULL, 0, NULL, &size)) && size > 0) {
+ {
/* always allow for a " " (space) character */
- totSize += (size + 1);
+ totSize += (size + 1);
/* after the data item */
+ }
+
}
+ }
if (totSize < 1)
return ISC_R_FAILURE;
qres = mysql_query((MYSQL *)dbi->dbconn, querystring);
if (qres == 0)
break;
- for (j = 0; j < 4; j++)
- if (mysql_ping((MYSQL *)dbi->dbconn) == 0)
+ for (j = 0; j < 4; j++) {
+ if (mysql_ping((MYSQL *)dbi->dbconn) == 0) {
break;
+ }
+ }
}
if (qres == 0) {
*query = '\0';
for (item = DLZ_LIST_HEAD(arglist); item != NULL;
- item = DLZ_LIST_NEXT(item, link))
- if (item->arg != NULL)
+ item = DLZ_LIST_NEXT(item, link)) {
+ if (item->arg != NULL) {
strcat(query, item->arg);
+ }
+ }
+
fail:
va_end(ap1);
(void)cfg_map_get(config, "view", &views);
- if (views != NULL && options != NULL)
- if (check_dual_stack(options, logctx) != ISC_R_SUCCESS)
+ if (views != NULL && options != NULL) {
+ if (check_dual_stack(options, logctx) != ISC_R_SUCCESS) {
result = ISC_R_FAILURE;
+ /*
+ * Use case insensitive comparision as not all file systems are
+ * case sensitive. This will prevent people using FOO.DB and foo.db
+ * on case sensitive file systems but that shouldn't be a major issue.
+ */
+ }
+ }
+
/*
* Use case insensitive comparision as not all file systems are
* case sensitive. This will prevent people using FOO.DB and foo.db
aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name"));
for (i = 0; i < sizeof(builtin) / sizeof(builtin[0]);
- i++)
+ i++) {
if (strcasecmp(aclname, builtin[i]) == 0) {
- cfg_obj_log(acl, logctx, ISC_LOG_ERROR,
- "attempt to redefine "
- "builtin acl '%s'",
- aclname);
- result = ISC_R_FAILURE;
- break;
+ {
+ cfg_obj_log(acl, logctx,
+ ISC_LOG_ERROR,
+ "attempt to redefine "
+ "builtin acl '%s'",
+ aclname);
+ result = ISC_R_FAILURE;
+ break;
+ }
+
}
+ }
for (elt2 = cfg_list_next(elt); elt2 != NULL;
elt2 = cfg_list_next(elt2)) {
/*
* Are we shutting down?
*/
- for (i = 0; i < adb->nentries; i++)
- if (adb->entry_sd[i])
+ for (i = 0; i < adb->nentries; i++) {
+ if (adb->entry_sd[i]) {
goto cleanup;
+ /*
+ * Grab all the resources we need.
+ */
+ }
+ }
+
/*
* Grab all the resources we need.
*/
/*
* Are we shutting down?
*/
- for (i = 0; i < adb->nnames; i++)
- if (adb->name_sd[i])
+ for (i = 0; i < adb->nnames; i++) {
+ if (adb->name_sd[i]) {
goto cleanup;
+ /*
+ * Grab all the resources we need.
+ */
+ }
+ }
+
/*
* Grab all the resources we need.
*/
link_entry(adb, addr_bucket, entry);
} else {
for (anh = ISC_LIST_HEAD(*hookhead); anh != NULL;
- anh = ISC_LIST_NEXT(anh, plink))
- if (anh->entry == foundentry)
+ anh = ISC_LIST_NEXT(anh, plink)) {
+ if (anh->entry == foundentry) {
break;
+ }
+ }
if (anh == NULL) {
foundentry->refcnt++;
foundentry->nh++;
cleanup_db:
dns_db_detach(&cache->db);
cleanup_dbargv:
- for (i = extra; i < cache->db_argc; i++)
- if (cache->db_argv[i] != NULL)
+ for (i = extra; i < cache->db_argc; i++) {
+ if (cache->db_argv[i] != NULL) {
isc_mem_free(cmctx, cache->db_argv[i]);
+ }
+ }
if (cache->db_argv != NULL)
isc_mem_put(cmctx, cache->db_argv,
cache->db_argc * sizeof(char *));
dns_dbimplementation_t *imp;
for (imp = ISC_LIST_HEAD(implementations); imp != NULL;
- imp = ISC_LIST_NEXT(imp, link))
- if (strcasecmp(name, imp->name) == 0)
+ imp = ISC_LIST_NEXT(imp, link)) {
+ if (strcasecmp(name, imp->name) == 0) {
return (imp);
+ }
+ }
return (NULL);
}
dns_dlzimplementation_t *imp;
for (imp = ISC_LIST_HEAD(dlz_implementations); imp != NULL;
- imp = ISC_LIST_NEXT(imp, link))
- if (strcasecmp(name, imp->name) == 0)
+ imp = ISC_LIST_NEXT(imp, link)) {
+ if (strcasecmp(name, imp->name) == 0) {
return (imp);
+ }
+ }
return (NULL);
}
dir.entry.name[i] != '+')
continue;
- for (i++; i < dir.entry.length; i++)
- if (dir.entry.name[i] < '0' || dir.entry.name[i] > '9')
+ for (i++; i < dir.entry.length; i++) {
+ if (dir.entry.name[i] < '0' || dir.entry.name[i] > '9') {
break;
+ /*
+ * Did we not read exactly 5 more digits?
+ * Did we overflow?
+ * Did we correctly terminate?
+ */
+ }
+ }
+
/*
* Did we not read exactly 5 more digits?
* Did we overflow?
RUNTIME_CHECK(dst_initialized == true);
dst_initialized = false;
- for (i = 0; i < DST_MAX_ALGS; i++)
- if (dst_t_func[i] != NULL && dst_t_func[i]->cleanup != NULL)
+ for (i = 0; i < DST_MAX_ALGS; i++) {
+ if (dst_t_func[i] != NULL && dst_t_func[i]->cleanup != NULL) {
dst_t_func[i]->cleanup();
+ }
+ }
dst__openssl_destroy();
#if USE_PKCS11
(void)dst__pkcs11_destroy();
have[i] = false;
for (j = 0; j < priv->nelements; j++) {
- for (i = 0; i < RSA_NTAGS; i++)
- if (priv->elements[j].tag == TAG(DST_ALG_RSA, i))
+ for (i = 0; i < RSA_NTAGS; i++) {
+ if (priv->elements[j].tag == TAG(DST_ALG_RSA, i)) {
break;
+ }
+ }
if (i == RSA_NTAGS)
return (-1);
have[i] = true;
if (priv->nelements != DH_NTAGS)
return (-1);
for (i = 0; i < DH_NTAGS; i++) {
- for (j = 0; j < priv->nelements; j++)
- if (priv->elements[j].tag == TAG(DST_ALG_DH, i))
+ for (j = 0; j < priv->nelements; j++) {
+ if (priv->elements[j].tag == TAG(DST_ALG_DH, i)) {
break;
+ }
+ }
if (j == priv->nelements)
return (-1);
}
for (i = 0; i < ECDSA_NTAGS; i++)
have[i] = false;
for (j = 0; j < priv->nelements; j++) {
- for (i = 0; i < ECDSA_NTAGS; i++)
- if (priv->elements[j].tag == TAG(DST_ALG_ECDSA256, i))
+ for (i = 0; i < ECDSA_NTAGS; i++) {
+ if (priv->elements[j].tag == TAG(DST_ALG_ECDSA256, i)) {
break;
+ }
+ }
if (i == ECDSA_NTAGS)
return (-1);
have[i] = true;
for (i = 0; i < EDDSA_NTAGS; i++)
have[i] = false;
for (j = 0; j < priv->nelements; j++) {
- for (i = 0; i < EDDSA_NTAGS; i++)
- if (priv->elements[j].tag == TAG(DST_ALG_ED25519, i))
+ for (i = 0; i < EDDSA_NTAGS; i++) {
+ if (priv->elements[j].tag == TAG(DST_ALG_ED25519, i)) {
break;
+ }
+ }
if (i == EDDSA_NTAGS)
return (-1);
have[i] = true;
* We must be new format at this point.
*/
for (i = 0; i < HMACMD5_NTAGS; i++) {
- for (j = 0; j < priv->nelements; j++)
- if (priv->elements[j].tag == TAG(DST_ALG_HMACMD5, i))
+ for (j = 0; j < priv->nelements; j++) {
+ if (priv->elements[j].tag == TAG(DST_ALG_HMACMD5, i)) {
break;
+ }
+ }
if (j == priv->nelements)
return (-1);
}
if (priv->nelements != ntags)
return (-1);
for (i = 0; i < ntags; i++) {
- for (j = 0; j < priv->nelements; j++)
- if (priv->elements[j].tag == TAG(alg, i))
+ for (j = 0; j < priv->nelements; j++) {
+ if (priv->elements[j].tag == TAG(alg, i)) {
break;
+ }
+ }
if (j == priv->nelements)
return (-1);
}
dyndb_implementation_t *imp;
for (imp = ISC_LIST_HEAD(dyndb_implementations); imp != NULL;
- imp = ISC_LIST_NEXT(imp, link))
- if (strcasecmp(name, imp->name) == 0)
+ imp = ISC_LIST_NEXT(imp, link)) {
+ if (strcasecmp(name, imp->name) == 0) {
return (imp);
+ }
+ }
return (NULL);
}
result = ISC_R_SUCCESS;
cleanup:
- if (result != ISC_R_SUCCESS)
- if (implementation != NULL)
+ if (result != ISC_R_SUCCESS) {
+ if (implementation != NULL) {
unload_library(&implementation);
+ }
+ }
+
UNLOCK(&dyndb_lock);
return (result);
}
if (p[0] == NULL && p[1] == NULL)
break;
- for (i = 0; i < 2; i++)
+ for (i = 0; i < 2; i++) {
if (p[!i] == NULL) {
- ISC_LIST_UNLINK(diff[i].tuples, p[i], link);
- ISC_LIST_APPEND(r->tuples, p[i], link);
- goto next;
+ {
+ ISC_LIST_UNLINK(diff[i].tuples, p[i],
+ link);
+ ISC_LIST_APPEND(r->tuples, p[i], link);
+ goto next;
+ }
}
+ }
t = rdata_order(&p[0], &p[1]);
if (t < 0) {
ISC_LIST_UNLINK(diff[0].tuples, p[0], link);
}
/*NOTREACHED*/
}
- if (eol != true)
- if (token->type == isc_tokentype_eol ||
- token->type == isc_tokentype_eof) {
- unsigned long int line;
- const char * what;
- const char * file;
- file = isc_lex_getsourcename(lex);
- line = isc_lex_getsourceline(lex);
- if (token->type == isc_tokentype_eol) {
- line--;
- what = "line";
- } else
- what = "file";
- (*callbacks->error)(callbacks,
- "dns_master_load: %s:%lu: "
- "unexpected end of %s",
- file, line, what);
- return (ISC_R_UNEXPECTEDEND);
- }
+ if (eol != true) {
+ if (token->type == isc_tokentype_eol || token->type == isc_tokentype_eof) {
+ {
+ unsigned long int line;
+ const char *what;
+ const char *file;
+ file = isc_lex_getsourcename(lex);
+ line = isc_lex_getsourceline(lex);
+ if (token->type == isc_tokentype_eol) {
+ line--;
+ what = "line";
+ }else
+ what = "file";
+ (*callbacks->error)(callbacks,
+ "dns_master_load: %s:%lu: "
+ "unexpected end of %s",
+ file, line, what);
+ return (ISC_R_UNEXPECTEDEND);
+ }
+ }
+ }
return (ISC_R_SUCCESS);
}
if (dns_name_countlabels(name) > 3U) {
dns_name_init(&prefix, NULL);
dns_name_getlabelsequence(name, 0, 3, &prefix);
- for (i = 0; i < (sizeof(dns_sd) / sizeof(dns_sd[0])); i++)
- if (dns_name_equal(&prefix, &dns_sd[i]))
+ for (i = 0; i < (sizeof(dns_sd) / sizeof(dns_sd[0])); i++) {
+ if (dns_name_equal(&prefix, &dns_sd[i])) {
return (true);
+ }
+ }
}
return (false);
{
size_t i;
- for (i = 0; i < (sizeof(rfc1918names) / sizeof(*rfc1918names)); i++)
- if (dns_name_issubdomain(name, &rfc1918names[i]))
+ for (i = 0; i < (sizeof(rfc1918names) / sizeof(*rfc1918names)); i++) {
+ if (dns_name_issubdomain(name, &rfc1918names[i])) {
return (true);
+ }
+ }
return (false);
}
{
size_t i;
- for (i = 0; i < (sizeof(ulanames) / sizeof(*ulanames)); i++)
- if (dns_name_issubdomain(name, &ulanames[i]))
+ for (i = 0; i < (sizeof(ulanames) / sizeof(*ulanames)); i++) {
+ if (dns_name_issubdomain(name, &ulanames[i])) {
return (true);
+ }
+ }
return (false);
}
for (window = 0; window < 256; window++) {
if (window * 256 > max_type)
break;
- for (octet = 31; octet >= 0; octet--)
- if (*(raw + octet) != 0)
+ for (octet = 31; octet >= 0; octet--) {
+ if (*(raw + octet) != 0) {
break;
+ }
+ }
if (octet < 0) {
raw += 32;
continue;
* More specifics to front of list.
*/
for (p = ISC_LIST_HEAD(peers->elements); p != NULL;
- p = ISC_LIST_NEXT(p, next))
- if (p->prefixlen < peer->prefixlen)
+ p = ISC_LIST_NEXT(p, next)) {
+ if (p->prefixlen < peer->prefixlen) {
break;
+ }
+ }
+
if (p != NULL)
ISC_LIST_INSERTBEFORE(peers->elements, p, peer, next);
else
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
- for (i = 5; i <= 6; i++)
+ for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
- memset(keyTemplate[i].pValue, 0,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ memset(keyTemplate[i].pValue, 0,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
}
+ }
pk11_return_session(pk11_ctx);
memset(pk11_ctx, 0, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
- for (i = 5; i <= 6; i++)
+ for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
- memset(keyTemplate[i].pValue, 0,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ memset(keyTemplate[i].pValue, 0,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
}
+ }
pk11_return_session(pk11_ctx);
memset(pk11_ctx, 0, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
- for (i = 5; i <= 6; i++)
+ for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
- memset(keyTemplate[i].pValue, 0,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ memset(keyTemplate[i].pValue, 0,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
}
+ }
pk11_return_session(pk11_ctx);
memset(pk11_ctx, 0, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
- for (i = 5; i <= 6; i++)
+ for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
- memset(keyTemplate[i].pValue, 0,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ memset(keyTemplate[i].pValue, 0,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
}
+ }
pk11_return_session(pk11_ctx);
memset(pk11_ctx, 0, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
dctx->ctxdata.pk11_ctx = pk11_ctx;
- for (i = 6; i <= 13; i++)
+ for (i = 6; i <= 13; i++) {
if (keyTemplate[i].pValue != NULL) {
- isc_safe_memwipe(keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ isc_safe_memwipe(keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
+
}
+ }
return (ISC_R_SUCCESS);
err:
if (!pk11_ctx->ontoken && (pk11_ctx->object != CK_INVALID_HANDLE))
(void)pkcs_C_DestroyObject(pk11_ctx->session, pk11_ctx->object);
- for (i = 6; i <= 13; i++)
+ for (i = 6; i <= 13; i++) {
if (keyTemplate[i].pValue != NULL) {
- isc_safe_memwipe(keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ isc_safe_memwipe(keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
}
+ }
pk11_return_session(pk11_ctx);
isc_safe_memwipe(pk11_ctx, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
dctx->ctxdata.pk11_ctx = pk11_ctx;
- for (i = 5; i <= 6; i++)
+ for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
- isc_safe_memwipe(keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ isc_safe_memwipe(keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
+
}
+ }
return (ISC_R_SUCCESS);
err:
if (!pk11_ctx->ontoken && (pk11_ctx->object != CK_INVALID_HANDLE))
(void)pkcs_C_DestroyObject(pk11_ctx->session, pk11_ctx->object);
- for (i = 5; i <= 6; i++)
+ for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
- isc_safe_memwipe(keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ isc_safe_memwipe(keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
}
+ }
pk11_return_session(pk11_ctx);
isc_safe_memwipe(pk11_ctx, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
err:
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
- for (i = 6; i <= 13; i++)
+ for (i = 6; i <= 13; i++) {
if (keyTemplate[i].pValue != NULL) {
- isc_safe_memwipe(keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ isc_safe_memwipe(keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
}
+ }
pk11_return_session(pk11_ctx);
isc_safe_memwipe(pk11_ctx, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
err:
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
- for (i = 5; i <= 6; i++)
+ for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
- isc_safe_memwipe(keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
- isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
- keyTemplate[i].ulValueLen);
+ {
+ isc_safe_memwipe(keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
+ keyTemplate[i].ulValueLen);
+ }
}
+ }
pk11_return_session(pk11_ctx);
isc_safe_memwipe(pk11_ctx, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
/*
* Relock a read lock, or unlock the write lock if no lock was held.
*/
- if (tlock == isc_rwlocktype_none)
- if (write_locked)
+ if (tlock == isc_rwlocktype_none) {
+ if (write_locked) {
RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_write);
- if (tlock == isc_rwlocktype_read)
- if (write_locked)
+ }
+ }
+
+ if (tlock == isc_rwlocktype_read) {
+ if (write_locked) {
isc_rwlock_downgrade(&rbtdb->tree_lock);
+ }
+ }
+
return (no_reference);
}
"reprieve by RETAIN() %s",
printname);
}
- } else if (isc_mem_isovermem(rbtdb->common.mctx) && log)
+ } else if (isc_mem_isovermem(rbtdb->common.mctx) && log) {
isc_log_write(dns_lctx, category, module, level,
"overmem cache: saved %s", printname);
+ }
NODE_UNLOCK(&rbtdb->node_locks[rbtnode->locknum].lock,
isc_rwlocktype_write);
* type so they can be marked ancient later.
*/
for (topheader = rbtnode->data; topheader != NULL;
- topheader = topheader->next)
- if (topheader->type == sigtype)
+ topheader = topheader->next) {
+ if (topheader->type == sigtype) {
sigheader = topheader;
+ }
+ }
negtype = RBTDB_RDATATYPE_VALUE(covers, 0);
} else {
/*
cleanup_heaps:
if (rbtdb->heaps != NULL) {
- for (i = 0; i < (int)rbtdb->node_lock_count; i++)
- if (rbtdb->heaps[i] != NULL)
+ for (i = 0; i < (int)rbtdb->node_lock_count; i++) {
+ if (rbtdb->heaps[i] != NULL) {
isc_heap_destroy(&rbtdb->heaps[i]);
+ }
+ }
isc_mem_put(hmctx, rbtdb->heaps,
rbtdb->node_lock_count * sizeof(isc_heap_t *));
}
*/
memset(header->upper, 0, sizeof(header->upper));
fully_lower = true;
- for (i = 0; i < name->length; i++)
+ for (i = 0; i < name->length; i++) {
if (name->ndata[i] >= 0x41 && name->ndata[i] <= 0x5a) {
- header->upper[i / 8] |= 1 << (i % 8);
- fully_lower = false;
+ {
+ header->upper[i / 8] |= 1 << (i % 8);
+ fully_lower = false;
+ }
}
+ }
header->attributes |= RDATASET_ATTR_CASESET;
if (ISC_LIKELY(fully_lower))
header->attributes |= RDATASET_ATTR_CASEFULLYLOWER;
*/
RWLOCK(&rbtversion->glue_rwlock, isc_rwlocktype_read);
- for (cur = rbtversion->glue_table[idx]; cur != NULL; cur = cur->next)
- if (cur->node == node)
+ for (cur = rbtversion->glue_table[idx]; cur != NULL; cur = cur->next) {
+ if (cur->node == node) {
break;
+ }
+ }
+
if (cur == NULL) {
goto no_glue;
}
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
false));
tr = token.value.as_textregion;
- for (i = 0; i < tr.length; i++)
- if (!alphanumeric[(unsigned char)tr.base[i]])
+ for (i = 0; i < tr.length; i++) {
+ if (!alphanumeric[(unsigned char)tr.base[i]]) {
RETTOK(DNS_R_SYNTAX);
+ }
+ }
RETERR(uint8_tobuffer(tr.length, target));
RETERR(mem_tobuffer(target, tr.base, tr.length));
RETERR(DNS_R_FORMERR);
/* Check the Tag's value */
- for (i = 0; i < len; i++)
- if (!alphanumeric[sr.base[i]])
+ for (i = 0; i < len; i++) {
+ if (!alphanumeric[sr.base[i]]) {
RETERR(DNS_R_FORMERR);
+ /*
+ * Tag + Value
+ */
+ }
+ }
/*
* Tag + Value
*/
*/
region.base = caa->tag;
region.length = caa->tag_len;
- for (i = 0; i < region.length; i++)
- if (!alphanumeric[region.base[i]])
+ for (i = 0; i < region.length; i++) {
+ if (!alphanumeric[region.base[i]]) {
RETERR(DNS_R_SYNTAX);
+ }
+ }
RETERR(isc_buffer_copyregion(target, ®ion));
/*
* We don't just multiply out as we will overflow.
*/
if (m > 0) {
- for (exp = 0; exp < 7; exp++)
- if (m < poweroften[exp + 1])
+ for (exp = 0; exp < 7; exp++) {
+ if (m < poweroften[exp + 1]) {
break;
+ }
+ }
man = m / poweroften[exp];
exp += 2;
} else {
* We don't just multiply out as we will overflow.
*/
if (m > 0) {
- for (exp = 0; exp < 7; exp++)
- if (m < poweroften[exp + 1])
+ for (exp = 0; exp < 7; exp++) {
+ if (m < poweroften[exp + 1]) {
break;
+ }
+ }
man = m / poweroften[exp];
exp += 2;
} else if (cm >= 10) {
* We don't just multiply out as we will overflow.
*/
if (m > 0) {
- for (exp = 0; exp < 7; exp++)
- if (m < poweroften[exp + 1])
+ for (exp = 0; exp < 7; exp++) {
+ if (m < poweroften[exp + 1]) {
break;
+ }
+ }
man = m / poweroften[exp];
exp += 2;
} else if (cm >= 10) {
* Size.
*/
c = sr.base[1];
- if (c != 0)
- if ((c & 0xf) > 9 || ((c >> 4) & 0xf) > 9 ||
- ((c >> 4) & 0xf) == 0)
+ if (c != 0) {
+ if ((c & 0xf) > 9 || ((c >> 4) & 0xf) > 9 || ((c >> 4) & 0xf) == 0) {
return (ISC_R_RANGE);
+ /*
+ * Horizontal precision.
+ */
+ }
+ }
+
/*
* Horizontal precision.
*/
c = sr.base[2];
- if (c != 0)
- if ((c & 0xf) > 9 || ((c >> 4) & 0xf) > 9 ||
- ((c >> 4) & 0xf) == 0)
+ if (c != 0) {
+ if ((c & 0xf) > 9 || ((c >> 4) & 0xf) > 9 || ((c >> 4) & 0xf) == 0) {
return (ISC_R_RANGE);
+ /*
+ * Vertical precision.
+ */
+ }
+ }
+
/*
* Vertical precision.
*/
c = sr.base[3];
- if (c != 0)
- if ((c & 0xf) > 9 || ((c >> 4) & 0xf) > 9 ||
- ((c >> 4) & 0xf) == 0)
+ if (c != 0) {
+ if ((c & 0xf) > 9 || ((c >> 4) & 0xf) > 9 || ((c >> 4) & 0xf) == 0) {
return (ISC_R_RANGE);
+ }
+ }
isc_region_consume(&sr, 4);
/*
for (i = 0; i < sr.length; i++) {
if (sr.base[i] != 0)
- for (j = 0; j < 8; j++)
+ for (j = 0; j < 8; j++) {
if ((sr.base[i] & (0x80 >> j)) != 0) {
- dns_rdatatype_t t = i * 8 + j;
- RETERR(str_totext(" ", target));
- if (dns_rdatatype_isknown(t)) {
- RETERR(dns_rdatatype_totext(
- t, target));
- } else {
+ {
+ dns_rdatatype_t t = i * 8 + j;
+ RETERR(str_totext(" ", target));
+ if (dns_rdatatype_isknown(t)) {
+ RETERR(dns_rdatatype_totext(t, target));
+ }else {
char buf[sizeof("65535")];
- snprintf(buf, sizeof(buf), "%u",
- t);
+ snprintf(buf, sizeof(buf),
+ "%u", t);
RETERR(str_totext(buf, target));
}
}
+ }
+ }
}
return (ISC_R_SUCCESS);
}
false));
if (token.value.as_textregion.length < 4)
RETTOK(DNS_R_SYNTAX);
- for (i = 0; i < token.value.as_textregion.length; i++)
- if (!isdigit(token.value.as_textregion.base[i] & 0xff))
+ for (i = 0; i < token.value.as_textregion.length; i++) {
+ if (!isdigit(token.value.as_textregion.base[i] & 0xff)) {
RETTOK(ISC_R_RANGE);
+ }
+ }
RETTOK(txt_fromtext(&token.value.as_textregion, target));
return (ISC_R_SUCCESS);
}
if (x25->x25_len < 4)
return (ISC_R_RANGE);
- for (i = 0; i < x25->x25_len; i++)
- if (!isdigit(x25->x25[i] & 0xff))
+ for (i = 0; i < x25->x25_len; i++) {
+ if (!isdigit(x25->x25[i] & 0xff)) {
return (ISC_R_RANGE);
+ }
+ }
+
RETERR(uint8_tobuffer(x25->x25_len, target));
return (mem_tobuffer(target, x25->x25, x25->x25_len));
}
RETTOK(DNS_R_BADDOTTEDQUAD);
if (prefix > 32)
RETTOK(ISC_R_RANGE);
- for (len = 4; len > 0; len--)
- if (addr[len - 1] != 0)
+ for (len = 4; len > 0; len--) {
+ if (addr[len - 1] != 0) {
break;
+ }
+ }
break;
case 2:
RETTOK(DNS_R_BADAAAA);
if (prefix > 128)
RETTOK(ISC_R_RANGE);
- for (len = 16; len > 0; len--)
- if (addr[len - 1] != 0)
+ for (len = 16; len > 0; len--) {
+ if (addr[len - 1] != 0) {
break;
+ }
+ }
break;
default:
* case sensitive and the database is usually in lowercase.
*/
strlcpy(service, DNS_AS_STR(token), sizeof(service));
- for (i = strlen(service) - 1; i >= 0; i--)
- if (isupper(service[i] & 0xff))
+ for (i = strlen(service) - 1; i >= 0; i--) {
+ if (isupper(service[i] & 0xff)) {
service[i] = tolower(service[i] & 0xff);
+ }
+ }
+
port = strtol(DNS_AS_STR(token), &e, 10);
if (*e == 0)
;
INSIST(sr.length <= 8 * 1024);
for (i = 0; i < sr.length; i++) {
if (sr.base[i] != 0)
- for (j = 0; j < 8; j++)
+ for (j = 0; j < 8; j++) {
if ((sr.base[i] & (0x80 >> j)) != 0) {
- snprintf(buf, sizeof(buf), "%u",
- i * 8 + j);
- RETERR(str_totext(" ", target));
- RETERR(str_totext(buf, target));
+ {
+ snprintf(buf, sizeof(buf),
+ "%u", i * 8 + j);
+ RETERR(str_totext(" ", target));
+ RETERR(str_totext(buf, target));
+ }
}
+ }
}
return (ISC_R_SUCCESS);
*/
rdatalist = rdataset->private1;
memset(rdatalist->upper, 0, sizeof(rdatalist->upper));
- for (i = 1; i < name->length; i++)
- if (name->ndata[i] >= 0x41 && name->ndata[i] <= 0x5a)
+ for (i = 1; i < name->length; i++) {
+ if (name->ndata[i] >= 0x41 && name->ndata[i] <= 0x5a) {
rdatalist->upper[i / 8] |= 1 << (i % 8);
+ /*
+ * Record that upper has been set.
+ */
+ }
+ }
/*
* Record that upper has been set.
*/
if (finish != NULL || age_untried)
for (addrinfo = ISC_LIST_HEAD(fctx->forwaddrs);
addrinfo != NULL;
- addrinfo = ISC_LIST_NEXT(addrinfo, publink))
- if (UNMARKED(addrinfo))
+ addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
+ if (UNMARKED(addrinfo)) {
dns_adb_agesrtt(fctx->adb, addrinfo, now);
+ }
+ }
+
if ((finish != NULL || age_untried) && TRIEDFIND(fctx))
for (find = ISC_LIST_HEAD(fctx->finds); find != NULL;
- find = ISC_LIST_NEXT(find, publink))
+ find = ISC_LIST_NEXT(find, publink)) {
for (addrinfo = ISC_LIST_HEAD(find->list);
addrinfo != NULL;
- addrinfo = ISC_LIST_NEXT(addrinfo, publink))
- if (UNMARKED(addrinfo))
+ addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
+ if (UNMARKED(addrinfo)) {
dns_adb_agesrtt(fctx->adb, addrinfo,
- now);
+ now);
+
+ }
+ }
+ }
if ((finish != NULL || age_untried) && TRIEDALT(fctx)) {
for (addrinfo = ISC_LIST_HEAD(fctx->altaddrs); addrinfo != NULL;
- addrinfo = ISC_LIST_NEXT(addrinfo, publink))
- if (UNMARKED(addrinfo))
+ addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
+ if (UNMARKED(addrinfo)) {
dns_adb_agesrtt(fctx->adb, addrinfo, now);
+ }
+ }
for (find = ISC_LIST_HEAD(fctx->altfinds); find != NULL;
- find = ISC_LIST_NEXT(find, publink))
+ find = ISC_LIST_NEXT(find, publink)) {
for (addrinfo = ISC_LIST_HEAD(find->list);
addrinfo != NULL;
- addrinfo = ISC_LIST_NEXT(addrinfo, publink))
- if (UNMARKED(addrinfo))
+ addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
+ if (UNMARKED(addrinfo)) {
dns_adb_agesrtt(fctx->adb, addrinfo,
- now);
+ now);
+ }
+ }
+ }
}
/*
if (!isstrictsubdomain(name, &fctx->domain))
continue;
for (rdataset = ISC_LIST_HEAD(name->list); rdataset != NULL;
- rdataset = ISC_LIST_NEXT(rdataset, link))
- if (rdataset->type == dns_rdatatype_ns)
+ rdataset = ISC_LIST_NEXT(rdataset, link)) {
+ if (rdataset->type == dns_rdatatype_ns) {
return (true);
+ }
+ }
}
return (false);
}
{
unsigned int size;
- for (size = 1024; size < (64 * 1024); size *= 2)
- if (len < size)
+ for (size = 1024; size < (64 * 1024); size *= 2) {
+ if (len < size) {
return (size);
+ }
+ }
return (65535);
}
* Suppress duplicates.
*/
for (inc = ISC_LIST_HEAD(zone->newincludes); inc != NULL;
- inc = ISC_LIST_NEXT(inc, link))
- if (strcmp(filename, inc->name) == 0)
+ inc = ISC_LIST_NEXT(inc, link)) {
+ if (strcmp(filename, inc->name) == 0) {
return;
+ }
+ }
+
inc = isc_mem_get(zone->mctx, sizeof(dns_include_t));
inc->name = isc_mem_strdup(zone->mctx, filename);
ISC_LINK_INIT(inc, link);
{
unsigned int i;
- for (i = 0; i < count; i++)
- if (!isc_sockaddr_equal(&oldlist[i], &newlist[i]))
+ for (i = 0; i < count; i++) {
+ if (!isc_sockaddr_equal(&oldlist[i], &newlist[i])) {
return (false);
+ }
+ }
return (true);
}
/*
* Did we get a good answer from all the masters?
*/
- for (j = 0; j < zone->masterscnt; j++)
+ for (j = 0; j < zone->masterscnt; j++) {
if (zone->mastersok[j] == false) {
- done = false;
- break;
+ {
+ done = false;
+ break;
+ }
}
+ }
} else
done = true;
if (!done) {
/*
* Did we get a good answer from all the masters?
*/
- for (j = 0; j < zone->masterscnt; j++)
+ for (j = 0; j < zone->masterscnt; j++) {
if (zone->mastersok[j] == false) {
- done = false;
- break;
+ {
+ done = false;
+ break;
+ }
}
+ }
} else
done = true;
if (!done) {
break;
case DNS_ZONESTATE_SOAQUERY:
for (zone = ISC_LIST_HEAD(zmgr->zones); zone != NULL;
- zone = ISC_LIST_NEXT(zone, link))
- if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_REFRESH))
+ zone = ISC_LIST_NEXT(zone, link)) {
+ if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_REFRESH)) {
count++;
+ }
+ }
break;
case DNS_ZONESTATE_ANY:
for (zone = ISC_LIST_HEAD(zmgr->zones); zone != NULL;
#endif
family = sa->sa_family;
- for (i = 0; afdl[i].a_af; i++)
+ for (i = 0; afdl[i].a_af; i++) {
if (afdl[i].a_af == family) {
- afd = &afdl[i];
- goto found;
+ {
+ afd = &afdl[i];
+ goto found;
+ }
}
+ }
ERR(EAI_FAMILY);
found:
* Terminate token search on NULL or EOL.
*/
while (*h != 0 && *h != '\r' && *h != '\n') {
- if (strncasecmp(h, value, vlen) == 0)
- if (strchr(eov, h[vlen]) != NULL)
+ if (strncasecmp(h, value, vlen) == 0) {
+ if (strchr(eov, h[vlen]) != NULL) {
return (true);
+ /*
+ * Skip to next token.
+ */
+ }
+ }
/*
* Skip to next token.
*/
REQUIRE(module == NULL || module->id < lctx->module_count);
for (channel = ISC_LIST_HEAD(lcfg->channels); channel != NULL;
- channel = ISC_LIST_NEXT(channel, link))
- if (strcmp(name, channel->name) == 0)
+ channel = ISC_LIST_NEXT(channel, link)) {
+ if (strcmp(name, channel->name) == 0) {
break;
+ }
+ }
+
if (channel == NULL)
return (ISC_R_NOTFOUND);
*/
if (lctx->debug_level == 0)
for (channel = ISC_LIST_HEAD(lctx->logconfig->channels);
- channel != NULL; channel = ISC_LIST_NEXT(channel, link))
- if (channel->type == ISC_LOG_TOFILE &&
- (channel->flags & ISC_LOG_DEBUGONLY) != 0 &&
- FILE_STREAM(channel) != NULL) {
- (void)fclose(FILE_STREAM(channel));
- FILE_STREAM(channel) = NULL;
+ channel != NULL; channel = ISC_LIST_NEXT(channel, link)) {
+ if (channel->type == ISC_LOG_TOFILE && (channel->flags & ISC_LOG_DEBUGONLY) != 0 && FILE_STREAM(channel) != NULL) {
+ {
+ (void)fclose(FILE_STREAM(channel));
+ FILE_STREAM(channel) = NULL;
+ }
}
+ }
UNLOCK(&lctx->lock);
}
LOCK(&lctx->lock);
for (channel = ISC_LIST_HEAD(lctx->logconfig->channels);
- channel != NULL; channel = ISC_LIST_NEXT(channel, link))
+ channel != NULL; channel = ISC_LIST_NEXT(channel, link)) {
- if (channel->type == ISC_LOG_TOFILE &&
- FILE_STREAM(channel) != NULL) {
- (void)fclose(FILE_STREAM(channel));
- FILE_STREAM(channel) = NULL;
+ if (channel->type == ISC_LOG_TOFILE && FILE_STREAM(channel) != NULL) {
+ {
+ (void)fclose(FILE_STREAM(channel));
+ FILE_STREAM(channel) = NULL;
+ }
}
+ }
UNLOCK(&lctx->lock);
}
switch (optype) {
case OP_ANY:
for (token = ISC_LIST_HEAD(tokens); token != NULL;
- token = ISC_LIST_NEXT(token, link))
- if (token->slotid == slot)
+ token = ISC_LIST_NEXT(token, link)) {
+ if (token->slotid == slot) {
break;
+ }
+ }
break;
default:
for (token = ISC_LIST_HEAD(tokens); token != NULL;
- token = ISC_LIST_NEXT(token, link))
- if (token->slotid == slot)
+ token = ISC_LIST_NEXT(token, link)) {
+ if (token->slotid == slot) {
break;
+ }
+ }
break;
}
if (token == NULL)
CK_ATTRIBUTE *attr;
for (attr = pk11_attribute_first(obj); attr != NULL;
- attr = pk11_attribute_next(obj, attr))
- if (attr->type == type)
+ attr = pk11_attribute_next(obj, attr)) {
+ if (attr->type == type) {
return (attr);
+ }
+ }
return (NULL);
}
if (token == NULL)
for (token = ISC_LIST_HEAD(tokens);
token != NULL;
- token = ISC_LIST_NEXT(token, link))
- if (pk11strcmp(v, l, token->name, 32))
+ token = ISC_LIST_NEXT(token, link)) {
+ if (pk11strcmp(v, l, token->name, 32)) {
break;
+ }
+ }
} else if (strcmp(a, "manufacturer") == 0) {
/* manufacturer: CK_TOKEN_INFO manufacturerID */
if (token == NULL)
for (token = ISC_LIST_HEAD(tokens);
token != NULL;
- token = ISC_LIST_NEXT(token, link))
- if (pk11strcmp(v, l, token->manuf, 32))
+ token = ISC_LIST_NEXT(token, link)) {
+ if (pk11strcmp(v, l, token->manuf, 32)) {
break;
+ }
+ }
} else if (strcmp(a, "serial") == 0) {
/* serial: CK_TOKEN_INFO serialNumber */
if (token == NULL)
for (token = ISC_LIST_HEAD(tokens);
token != NULL;
- token = ISC_LIST_NEXT(token, link))
- if (pk11strcmp(v, l, token->serial, 16))
+ token = ISC_LIST_NEXT(token, link)) {
+ if (pk11strcmp(v, l, token->serial, 16)) {
break;
+ }
+ }
} else if (strcmp(a, "model") == 0) {
/* model: CK_TOKEN_INFO model */
if (token == NULL)
for (token = ISC_LIST_HEAD(tokens);
token != NULL;
- token = ISC_LIST_NEXT(token, link))
- if (pk11strcmp(v, l, token->model, 16))
+ token = ISC_LIST_NEXT(token, link)) {
+ if (pk11strcmp(v, l, token->model, 16)) {
break;
+ }
+ }
} else if (strcmp(a, "library-manufacturer") == 0) {
/* ignored */
} else if (strcmp(a, "library-description") == 0) {
}
}
}
- if (unlink(file) < 0)
- if (errno != ENOENT)
+ if (unlink(file) < 0) {
+ if (errno != ENOENT) {
return (isc__errno2result(errno));
+ }
+ }
return (ISC_R_SUCCESS);
}
braces++;
else if (pctx->token.value.as_char == '}')
braces--;
- else if (pctx->token.value.as_char == ';')
- if (braces == 0)
+ else if (pctx->token.value.as_char == ';') {
+ if (braces == 0) {
break;
+ }
+ }
}
if (pctx->token.type == isc_tokentype_eof || braces < 0) {
cfg_parser_error(pctx, CFG_LOG_NEAR,
msg = qctx->client->message;
for (name = ISC_LIST_HEAD(msg->sections[section]); name != NULL;
- name = ISC_LIST_NEXT(name, link))
+ name = ISC_LIST_NEXT(name, link)) {
if (dns_name_equal(name, qctx->client->query.qname)) {
for (rdataset = ISC_LIST_HEAD(name->list);
rdataset != NULL;
- rdataset = ISC_LIST_NEXT(rdataset, link))
- if (rdataset->type == qctx->qtype)
+ rdataset = ISC_LIST_NEXT(rdataset, link)) {
+ if (rdataset->type == qctx->qtype) {
break;
+ }
+ }
break;
}
+ }
if (rdataset != NULL) {
ISC_LIST_UNLINK(msg->sections[section], name, link);
ISC_LIST_PREPEND(msg->sections[section], name, link);