Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
conf/ile: make sure buffer is large enough
conf.c: In function 'lxc_assign_network': conf.c:3096:25: error: '%lu' directive output may be truncated writing between 1 and 20 bytes into a region of size 19 [-Werror=format-truncation=] snprintf(pidstr, 19, "%lu", (unsigned long) pid); ^~~ conf.c:3096:24: note: using the range [1, 18446744073709551615] for directive argument snprintf(pidstr, 19, "%lu", (unsigned long) pid); ^~~~~ In file included from /usr/include/stdio.h:938:0, from conf.c:35: /usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: format output between 2 and 21 bytes into a destination of size 19 return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __bos (__s), __fmt, __va_arg_pack ()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ confile.c: In function 'network_new_hwaddrs': confile.c:2889:38: error: '%02x' directive output may be truncated writing between 2 and 8 bytes into a region of size 6 [-Werror=format-truncation=] snprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x", ^~~~ confile.c:2889:23: note: using the range [0, 4294967295] for directive argument snprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x", ^~~~~~~~~~~~~~~~~~~~~~~~~ confile.c:2889:23: note: using the range [0, 4294967295] for directive argument In file included from /usr/include/stdio.h:938:0, from confile.c:24: /usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: format output between 18 and 36 bytes into a destination of size 18 return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __bos (__s), __fmt, __va_arg_pack ()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Not sure whether the latter is really a problem. We might need an additional fix later on. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
- Loading branch information
Christian Brauner
committed
Feb 2, 2017
1 parent
4ce8408
commit 091045f
Showing
3 changed files
with
68 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters