This commit silences the following Coverity warning: CID 1412118 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)6. buffer_size_warning: Calling strncpy with a maximum size argument of 4096 bytes on destination array mount->name of size 4096 bytes might leave the destination string unterminated.
Note that there are several areas (including this piece of code) in libcgroup that do not gracefully handle string truncation. That will be addressed in future patches. Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com> --- src/config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config.c b/src/config.c index 48d73cae9005..3ffa26371405 100644 --- a/src/config.c +++ b/src/config.c @@ -652,6 +652,7 @@ static int cgroup_config_ajdust_mount_options(struct cg_mount_table_s *mount, if (controller == NULL) break; strncpy(mount->name, controller, sizeof(mount->name)); + mount->name[sizeof(mount->name)-1] = '\0'; } if (strncmp(token, "nodev", strlen("nodev")) == 0) { -- 1.8.3.1 _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel