From 0ee14aa59402247c2726ac18c59f54d7636d9c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 10 May 2018 09:43:38 +0200 Subject: [PATCH] Use a while loop instead of a for loop in dns__zone_updatesigs() Replace the outer for loop with a while loop to emphasize it keeps processing the first element of diff->tuples, which changes on each iteration due to tuples being removed from diff->tuples by move_matching_tuples(). --- lib/dns/zone.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 0f63fccda1..9274cd1d28 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -7338,9 +7338,7 @@ dns__zone_updatesigs(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *version, dns_difftuple_t *tuple; isc_result_t result; - for (tuple = ISC_LIST_HEAD(diff->tuples); - tuple != NULL; - tuple = ISC_LIST_HEAD(diff->tuples)) { + while ((tuple = ISC_LIST_HEAD(diff->tuples)) != NULL) { isc_stdtime_t exp = expire; if (keyexpire != 0 &&