This repository has been archived by the owner on Jun 18, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build failure with GCC 7 due to possible truncation of snprintf o…
…utput setools fails to build under GCC7 -Wformat -Werror with the following error: x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wno-sign-compare -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ilibqpol -Ilibqpol/include -I/usr/include/python3.6m -c libqpol/policy_extend.c -o build/temp.linux-amd64-3.6/libqpol/policy_extend.o -Werror -Wextra -Waggregate-return -Wfloat-equal -Wformat -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-include-dirs -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wunknown-pragmas -Wwrite-strings -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-qual -Wno-shadow -Wno-unreachable-code -fno-exceptions libqpol/policy_extend.c: In function 'policy_extend': libqpol/policy_extend.c:161:27: error: '%04zd' directive output may be truncated writing between 4 and 10 bytes into a region of size 5 [-Werror=format-truncation=] snprintf(buff, 9, "@ttr%04zd", i + 1); ^~~~~ libqpol/policy_extend.c:161:22: note: directive argument in the range [1, 4294967295] snprintf(buff, 9, "@ttr%04zd", i + 1); ^~~~~~~~~~~ Increase the size of the buffer to avoid collisions Closes: #174 Signed-off-by: Laurent Bigonville <bigon@bigon.be>
- Loading branch information