-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make print methods in libnml/rcs/rcs_print.cc handle any size strings
Rewrite rcs_vprint(), rcs_print() and rcs_print_sys_error() to always print full string and drop use of static fixed size temp string. Also make sure trailing NUL is counted when copying strings into list of last errors. Set output limit to 2^16 to avoid any malloc bombs. This is the warning. Compiling libnml/rcs/rcs_print.cc In file included from /usr/include/string.h:495, from libnml/rcs/rcs_print.cc:21: In function ‘char* strncpy(char*, const char*, size_t)’, inlined from ‘int rcs_vprint(const char*, __va_list_tag*, int)’ at libnml/rcs/rcs_print.cc:311:9: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output may be truncated copying 99 bytes from a string of length 255 [-Wstringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Compiling libnml/rcs/rcs_exit.cc
- Loading branch information
1 parent
4c34757
commit 2ffe72b
Showing
1 changed file
with
93 additions
and
28 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