From: Witold Kręcicki Date: Fri, 31 May 2019 08:43:53 +0000 (+0200) Subject: Address GCC 8.3 -O3 compilation warning X-Git-Tag: v9.14.4~29^2~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=a0621b51d84d3405cb5e68e2cbd2467624540cb7;p=thirdparty%2Fbind9.git Address GCC 8.3 -O3 compilation warning Compiling with -O3 triggers the following warning with GCC 8.3: driver.c: In function ‘dlz_findzonedb’: driver.c:193:29: warning: ‘%u’ directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 99 [-Wformat-truncation=] snprintf(buffer, size, "%s#%u", addr_buf, port); ^~ driver.c:193:25: note: directive argument in the range [0, 65535] snprintf(buffer, size, "%s#%u", addr_buf, port); ^~~~~~~ driver.c:193:2: note: ‘snprintf’ output between 3 and 106 bytes into a destination of size 100 snprintf(buffer, size, "%s#%u", addr_buf, port); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Increase the size of the relevant array to prevent this warning from being triggered. (cherry picked from commit 44e6bb8b9318b5992194356a4898983ae10bf67c) --- diff --git a/bin/tests/system/dlzexternal/driver.c b/bin/tests/system/dlzexternal/driver.c index e7a17caf112..66fc0697545 100644 --- a/bin/tests/system/dlzexternal/driver.c +++ b/bin/tests/system/dlzexternal/driver.c @@ -168,7 +168,7 @@ del_name(struct dlz_example_data *state, struct record *list, static isc_result_t fmt_address(isc_sockaddr_t *addr, char *buffer, size_t size) { - char addr_buf[100]; + char addr_buf[INET6_ADDRSTRLEN]; const char *ret; uint16_t port = 0;