]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
config: fix string termination issues
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 6 Jul 2022 20:24:19 +0000 (14:24 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 6 Jul 2022 20:24:21 +0000 (14:24 -0600)
commitb54845ab05bdbbf8adc682770fde56c8cb0ce3b7
tree25347c00fb28356989c1b12581a0fd7ab4951dfc
parente60b87549089e35ba29a6cc1e209a0a019583878
config: fix string termination issues

Fix non-terminated string warnings, reported by the Coverity tool:

CID 258293 (#2 of 2): Copy into fixed size buffer (STRING_OVERFLOW).
fixed_size_dest: You might overrun the 32-character fixed-size string
config_namespace_table[namespace_table_index].name by copying name
without checking the length.

fix one another similar string
config_namespace_table[namespace_table_index].mount.path in the same
function cgroup_config_insert_into_namespace_table() by explicitly
terminating by appending '\0';

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit 8eee916573cd9a67713dd645d644d22759f39a69)
src/config.c