]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add ISC_FORMAT_PRINTF to report's declaration
authorMark Andrews <marka@isc.org>
Mon, 13 Mar 2023 02:48:20 +0000 (13:48 +1100)
committerMark Andrews <marka@isc.org>
Tue, 14 Mar 2023 05:26:56 +0000 (16:26 +1100)
dns_dnssec_updatekeys's 'report' could be called with invalid arguments
which the compiler should be be able to detect.

(cherry picked from commit 7a0a2fc3e4e3bb9c5869fe0953d97f6019fb0967)

lib/dns/dnssec.c
lib/dns/include/dns/dnssec.h

index b59ac6a16ecb8c9234fa1ca9418107c896669845..a7049eb678b9dacd9f89100bfe6bf3eb493ca69f 100644 (file)
@@ -1896,7 +1896,8 @@ failure:
 
 static isc_result_t
 publish_key(dns_diff_t *diff, dns_dnsseckey_t *key, const dns_name_t *origin,
-           dns_ttl_t ttl, isc_mem_t *mctx, void (*report)(const char *, ...)) {
+           dns_ttl_t ttl, isc_mem_t *mctx,
+           void (*report)(const char *, ...) ISC_FORMAT_PRINTF(1, 2)) {
        isc_result_t result;
        unsigned char buf[DST_KEY_MAXSIZE];
        char keystr[DST_KEY_FORMATSIZE];
@@ -1913,7 +1914,8 @@ publish_key(dns_diff_t *diff, dns_dnsseckey_t *key, const dns_name_t *origin,
        if (key->prepublish && ttl > key->prepublish) {
                isc_stdtime_t now;
 
-               report("Key %s: Delaying activation to match the DNSKEY TTL.",
+               report("Key %s: Delaying activation to match the DNSKEY TTL "
+                      "(%u).",
                       keystr, ttl);
 
                isc_stdtime_get(&now);
@@ -1930,7 +1932,7 @@ failure:
 static isc_result_t
 remove_key(dns_diff_t *diff, dns_dnsseckey_t *key, const dns_name_t *origin,
           dns_ttl_t ttl, isc_mem_t *mctx, const char *reason,
-          void (*report)(const char *, ...)) {
+          void (*report)(const char *, ...) ISC_FORMAT_PRINTF(1, 2)) {
        isc_result_t result;
        unsigned char buf[DST_KEY_MAXSIZE];
        dns_rdata_t dnskey = DNS_RDATA_INIT;
@@ -2250,7 +2252,8 @@ isc_result_t
 dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
                      dns_dnsseckeylist_t *removed, const dns_name_t *origin,
                      dns_ttl_t hint_ttl, dns_diff_t *diff, isc_mem_t *mctx,
-                     void (*report)(const char *, ...)) {
+                     void (*report)(const char *, ...)
+                             ISC_FORMAT_PRINTF(1, 2)) {
        isc_result_t result;
        dns_dnsseckey_t *key, *key1, *key2, *next;
        bool found_ttl = false;
index d96d0a7c80bcaaf6c74103dae411aa46639ac9b5..6add7d50d150ac910eca4b356d6038369ed827d5 100644 (file)
@@ -326,7 +326,8 @@ isc_result_t
 dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
                      dns_dnsseckeylist_t *removed, const dns_name_t *origin,
                      dns_ttl_t hint_ttl, dns_diff_t *diff, isc_mem_t *mctx,
-                     void (*report)(const char *, ...));
+                     void (*report)(const char *, ...)
+                             ISC_FORMAT_PRINTF(1, 2));
 /*%<
  * Update the list of keys in 'keys' with new key information in 'newkeys'.
  *