bin/named/unix/os.c warning: '%s' directive output may be truncated on OpenIndiana
BIND 9.16.4 compilation with GCC 7.5 on OpenIndiana 2020.04 (illumos-6682e4c38c
) emitted warning in bin/named/unix/os.c
:
libtool: compile: /usr/gcc/7/bin/gcc -include /export/home/newman/oi-userland/components/network/bind/build/amd64/config.h -I/export/home/newman/oi-userland/components/network/bind/build/amd64 -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4 -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4/bin/named/unix/include -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4/bin/named/unix/../include -I/export/home/newman/oi-userland/components/network/bind/build/amd64/lib/isccfg/include -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4/lib/isccfg/include -I/export/home/newman/oi-userland/components/network/bind/build/amd64/lib/isccc/include -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4/lib/isccc/include -I/export/home/newman/oi-userland/components/network/bind/build/amd64/lib/dns/include -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4/lib/dns/include -I/export/home/newman/oi-userland/components/network/bind/build/amd64/lib/isc/include -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4/lib/isc -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4/lib/isc/include -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4/lib/isc/unix/include -I/export/home/newman/oi-userland/components/network/bind/bind-9.16.4/lib/isc/pthreads/include -m64 -O3 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6 -D_POSIX_PTHREAD_SEMANTICS -pthread -fPIC -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -Wno-missing-field-initializers -fno-strict-aliasing -c os.c -fPIC -DPIC -o .libs/os.o
os.c: In function 'getuname':
os.c:920:49: warning: '%s' directive output may be truncated writing up to 256 bytes into a region of size between 253 and 1021 [-Wformat-truncation=]
snprintf(unamebuf, sizeof(unamebuf), "%s %s %s %s", uts.sysname,
^~
uts.machine, uts.release, uts.version);
~~~
os.c:920:2: note: 'snprintf' output between 4 and 1028 bytes into a destination of size 1024
snprintf(unamebuf, sizeof(unamebuf), "%s %s %s %s", uts.sysname,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uts.machine, uts.release, uts.version);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
illumos snprintf(3c).