]> git.ipfire.org Git - thirdparty/bind9.git/commit
Address GCC 8.3 -O3 compilation warning
authorWitold Kręcicki <wpk@isc.org>
Fri, 31 May 2019 08:43:53 +0000 (10:43 +0200)
committerMichał Kępień <michal@isc.org>
Tue, 11 Jun 2019 08:18:58 +0000 (10:18 +0200)
commita0621b51d84d3405cb5e68e2cbd2467624540cb7
tree128d8132f8056087cb98f0deb4741af539fcc8a7
parentbd501abaa659d6c551177daf945874e46b165c4f
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)
bin/tests/system/dlzexternal/driver.c