]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
in rdbdb.c:setsigningtime stop breaking heap invariant property unless we are going...
authorMark Andrews <marka@isc.org>
Thu, 23 Nov 2017 21:47:52 +0000 (08:47 +1100)
committerMark Andrews <marka@isc.org>
Thu, 23 Nov 2017 21:51:01 +0000 (08:51 +1100)
(cherry picked from commit 6ead410268963ff07641170a17dcc98600c3aaaa)

lib/dns/rbtdb.c

index e1bbc341779ddd4ed15448a2737ce9f57a011dbc..d1d8049ad8a137fc9821c5a74213053b25195548 100644 (file)
@@ -8119,8 +8119,16 @@ setsigningtime(dns_db_t *db, dns_rdataset_t *rdataset, isc_stdtime_t resign) {
                  isc_rwlocktype_write);
 
        oldheader = *header;
-       header->resign = (isc_stdtime_t)(dns_time64_from32(resign) >> 1);
-       header->resign_lsb = resign & 0x1;
+       /*
+        * Only break the heap invariant (by adjusting resign and resign_lsb)
+        * if we are going to be restoring it by calling isc_heap_increased
+        * or isc_heap_decreased.
+        */
+       if (resign != 0) {
+               header->resign =
+                        (isc_stdtime_t)(dns_time64_from32(resign) >> 1);
+               header->resign_lsb = resign & 0x1;
+       }
        if (header->heap_index != 0) {
                INSIST(RESIGN(header));
                if (resign == 0) {