]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tools/cgxget: replace strcat() with strncat()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 12 Jul 2022 17:21:57 +0000 (11:21 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 12 Jul 2022 17:22:01 +0000 (11:22 -0600)
commit7469fd86791bc94cfd965585f930833b1fd81e51
tree681e3dea7334ef7dcb2c553b551c2cedd9879b8a
parentaeded1e4176978d9705dbc5f9d9609ebf843b189
tools/cgxget: replace strcat() with strncat()

Fix copy into fixed size buffer warning, reported by Coverity tool:

CID 258284 (#4 of 4): Copy into fixed size buffer (STRING_OVERFLOW)1.
fixed_size_dest: You might overrun the 4096-character fixed-size string
tmp_val by copying tok without checking the length.

In indent_multiline_value(), warned about the usage of strcat(), that
might overwrite the string. Fix it by replacing strcat() -> strncat()
in the function.

Signed-off-by: Kamalesh Babulal kamalesh.babulal@oracle.com
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/cgxget.c