Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/tcp.c: increase the size of szHname #118

Merged

Conversation

Mingli-Yu
Copy link

@Mingli-Yu Mingli-Yu commented Jul 30, 2018

Increase the size of szHname to fix below
error:
| ../../git/src/tcp.c: In function 'relpTcpSetRemHost':
| ../../git/src/tcp.c:887:57: error: '%s' directive output may be truncated writing up to 1024 bytes into a region of size 1011 [-Werror=format-truncation=]
| snprintf((char*)szHname, NI_MAXHOST, "[MALICIOUS:IP=%s]", szIP);
| ^~ ~~~~
| In file included from /poky-build/tmp/work/i586-poky-linux/librelp/1.2.16-r0/recipe-sysroot/usr/include/stdio.h:862,
| from ../../git/src/tcp.c:38:
| /poky-build/tmp/work/i586-poky-linux/librelp/1.2.16-r0/recipe-sysroot/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 16 and 1040 bytes into a destination of size 1025
| return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| cc1: all warnings being treated as errors
| Makefile:536: recipe for target 'librelp_la-tcp.lo' failed

Signed-off-by: Mingli Yu mingli.yu@windriver.com

Inclease the size of szHname to fix below
error:
| ../../git/src/tcp.c: In function 'relpTcpSetRemHost':
| ../../git/src/tcp.c:887:57: error: '%s' directive output may be truncated writing up to 1024 bytes into a region of size 1011 [-Werror=format-truncation=]
|      snprintf((char*)szHname, NI_MAXHOST, "[MALICIOUS:IP=%s]", szIP);
|                                                          ^~    ~~~~
| In file included from /poky-build/tmp/work/i586-poky-linux/librelp/1.2.16-r0/recipe-sysroot/usr/include/stdio.h:862,
|                  from ../../git/src/tcp.c:38:
| /poky-build/tmp/work/i586-poky-linux/librelp/1.2.16-r0/recipe-sysroot/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 16 and 1040 bytes into a destination of size 1025
|    return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
|           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|         __bos (__s), __fmt, __va_arg_pack ());
|         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| cc1: all warnings being treated as errors
| Makefile:536: recipe for target 'librelp_la-tcp.lo' failed

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
@rgerhards rgerhards merged commit 3c137bb into rsyslog:master Aug 2, 2018
@rgerhards rgerhards added this to the v1.2.17 milestone Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants