]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix logging a uint32_t SOA serial value in dns_catz_update_from_db()
authorAram Sargsyan <aram@isc.org>
Wed, 14 Dec 2022 14:40:31 +0000 (14:40 +0000)
committerAram Sargsyan <aram@isc.org>
Thu, 15 Dec 2022 13:24:58 +0000 (13:24 +0000)
The dns_catz_update_from_db() function prints serial number as a signed
number (with "%d" in the format string), but the `vers` variable's type
is 'uint32_t'. This breaks serials bigger than 2^31.

Use PRIu32 instead of "d" in the format string.

lib/dns/catz.c

index fd24410594e3fb5fec08fefff2047b55432c31a2..b755e6cce569b853dd16546bceb39e270c01304c 100644 (file)
@@ -2167,8 +2167,8 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
 
        isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
                      ISC_LOG_INFO,
-                     "catz: updating catalog zone '%s' with serial %d", bname,
-                     vers);
+                     "catz: updating catalog zone '%s' with serial %" PRIu32,
+                     bname, vers);
 
        result = dns_catz_new_zone(catzs, &newzone, &db->origin);
        if (result != ISC_R_SUCCESS) {