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

make all ISC_LIST_FOREACH calls safe

previously, ISC_LIST_FOREACH and ISC_LIST_FOREACH_SAFE were
two separate macros, with the _SAFE version allowing entries
to be unlinked during the loop. ISC_LIST_FOREACH is now also
safe, and the separate _SAFE macro has been removed.

similarly, the ISC_LIST_FOREACH_REV macro is now safe, and
ISC_LIST_FOREACH_REV_SAFE has also been removed.
This commit is contained in:
Evan Hunt
2025-05-23 13:02:22 -07:00
parent 94c4181442
commit 8487e43ad9
58 changed files with 198 additions and 213 deletions

View File

@@ -130,7 +130,7 @@ dns_diff_init(isc_mem_t *mctx, dns_diff_t *diff) {
void
dns_diff_clear(dns_diff_t *diff) {
REQUIRE(DNS_DIFF_VALID(diff));
ISC_LIST_FOREACH_SAFE (diff->tuples, t, link) {
ISC_LIST_FOREACH (diff->tuples, t, link) {
ISC_LIST_UNLINK(diff->tuples, t, link);
dns_difftuple_free(&t);
}
@@ -184,7 +184,7 @@ dns_diff_appendminimal(dns_diff_t *diff, dns_difftuple_t **tuplep) {
* the one we are doing, there must be a programming
* error. We report it but try to continue anyway.
*/
ISC_LIST_FOREACH_SAFE (diff->tuples, ot, link) {
ISC_LIST_FOREACH (diff->tuples, ot, link) {
if (dns_name_caseequal(&ot->name, &(*tuplep)->name) &&
dns_rdata_compare(&ot->rdata, &(*tuplep)->rdata) == 0 &&
ot->ttl == (*tuplep)->ttl)