]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tools/cgget: replace strcat() with strncat()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 12 Jul 2022 17:23:58 +0000 (11:23 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 12 Jul 2022 17:24:01 +0000 (11:24 -0600)
commit9c8724c1e543026453365aaeca7ece93dc12dac7
tree2b76936b9a31440068ecc9a79f33538c0785a137
parent7469fd86791bc94cfd965585f930833b1fd81e51
tools/cgget: 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/cgget.c