]> 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:24:55 +0000 (11:24 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 12 Jul 2022 17:24:58 +0000 (11:24 -0600)
commitd2e2c7510d47d544b662cf6be2b4b5932491a046
tree09c7977eeec9d46309dd728004270c3123d982a5
parent80452cd88bfa6118df20b81b90a98d3d46dd0190
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>
(cherry picked from commit 9c8724c1e543026453365aaeca7ece93dc12dac7)
src/tools/cgget.c