]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Address GCC 8 -Wformat-truncation warnings
authorMichał Kępień <michal@isc.org>
Wed, 9 May 2018 06:09:54 +0000 (08:09 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 10 May 2018 08:54:38 +0000 (10:54 +0200)
(cherry picked from commit 172d0c401e058854ca2ac41bba4c09b87dbcf814)

bin/named/notify.c
bin/named/server.c
lib/dns/dnssec.c
lib/dns/rdata/generic/loc_29.c
lib/isc/unix/file.c
lib/isc/win32/file.c

index 3022ce430c2c2bc47db29d9f2fa1ee6f7fc734d3..7dce74bc5acd12554521c817bffd42eb9ecd6f83 100644 (file)
@@ -74,7 +74,7 @@ ns_notify_start(ns_client_t *client) {
        dns_rdataset_t *zone_rdataset;
        dns_zone_t *zone = NULL;
        char namebuf[DNS_NAME_FORMATSIZE];
-       char tsigbuf[DNS_NAME_FORMATSIZE + sizeof(": TSIG ''")];
+       char tsigbuf[DNS_NAME_FORMATSIZE * 2 + sizeof(": TSIG '' ()")];
        dns_tsigkey_t *tsigkey;
 
        /*
index 99fca3b4eb2f3c2556b6a8a1d40c70ce3b3013c6..b71a14b617b26d8dceefad4173eeb1d9ffa9e6c2 100644 (file)
@@ -13177,7 +13177,8 @@ ns_server_zonestatus(ns_server_t *server, isc_lex_t *lex,
        const char *type, *file;
        char zonename[DNS_NAME_FORMATSIZE];
        isc_uint32_t serial, signed_serial, nodes;
-       char serbuf[16], sserbuf[16], nodebuf[16], resignbuf[512];
+       char serbuf[16], sserbuf[16], nodebuf[16];
+       char resignbuf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE + 2];
        char lbuf[ISC_FORMATHTTPTIMESTAMP_SIZE];
        char xbuf[ISC_FORMATHTTPTIMESTAMP_SIZE];
        char rbuf[ISC_FORMATHTTPTIMESTAMP_SIZE];
index 2eb6413cec516e051b792ce42b2f01fce143022b..1045f8ff2131edb203716dc3b27a3855a71a0454 100644 (file)
@@ -799,7 +799,9 @@ dns_dnssec_findzonekeys3(dns_db_t *db, dns_dbversion_t *ver,
                }
 
                if (result != ISC_R_SUCCESS) {
-                       char filename[ISC_DIR_NAMEMAX];
+                       char filename[DNS_NAME_FORMATSIZE +
+                                     DNS_SECALG_FORMATSIZE +
+                                     sizeof("key file for //65535")];
                        isc_result_t result2;
                        isc_buffer_t buf;
 
@@ -1729,7 +1731,9 @@ dns_dnssec_keylistfromrdataset(dns_name_t *origin,
                }
 
                if (result != ISC_R_SUCCESS) {
-                       char filename[ISC_DIR_NAMEMAX];
+                       char filename[DNS_NAME_FORMATSIZE +
+                                     DNS_SECALG_FORMATSIZE +
+                                     sizeof("key file for //65535")];
                        isc_result_t result2;
                        isc_buffer_t buf;
 
index e0b72514abeb9fa4a8f6704efb33ba6398d6a46c..fb5edcd2b4e2cc1eb066a8687f172222b8b38554 100644 (file)
@@ -459,7 +459,7 @@ totext_loc(ARGS_TOTEXT) {
        isc_boolean_t below;
        isc_region_t sr;
        char buf[sizeof("89 59 59.999 N 179 59 59.999 E "
-                       "42849672.95m 90000000m 90000000m 90000000m")];
+                       "-42849672.95m 90000000m 90000000m 90000000m")];
        char sbuf[sizeof("90000000m")];
        char hbuf[sizeof("90000000m")];
        char vbuf[sizeof("90000000m")];
index 0f305b57a3a8c1ca233bf3fd429dd101737176fe..efa0f2f933a898e8359a5600fe991d3974a7604c 100644 (file)
@@ -714,7 +714,7 @@ isc_result_t
 isc_file_sanitize(const char *dir, const char *base, const char *ext,
                  char *path, size_t length)
 {
-       char buf[PATH_MAX], hash[PATH_MAX];
+       char buf[PATH_MAX], hash[ISC_SHA256_DIGESTSTRINGLENGTH];
        size_t l = 0;
 
        REQUIRE(base != NULL);
index cdd9b11c1b4424252973e05c1799eb80667d62c0..6c945636c0c44992530f467ae31ea642a8d25429 100644 (file)
@@ -785,7 +785,7 @@ isc_result_t
 isc_file_sanitize(const char *dir, const char *base, const char *ext,
                  char *path, size_t length)
 {
-       char buf[PATH_MAX], hash[PATH_MAX];
+       char buf[PATH_MAX], hash[ISC_SHA256_DIGESTSTRINGLENGTH];
        size_t l = 0;
 
        REQUIRE(base != NULL);