Fix non-terminated string warning, reported by Coverity tool:
CID 258266 (#1 of 1): String not null-terminated (STRING_NULL).
string_null: Passing unterminated string con to strtok, which expects a
null-terminated string.
Fix the warning in create_cgroup_from_name_value_pairs(), by adding
'\0'.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit
0fd476b6a6f309ccd3b0c473c844a27e7620cddd)
}
strncpy(con, name_value[i].name, FILENAME_MAX - 1);
+ con[FILENAME_MAX - 1] = '\0';
+
strtok(con, ".");
/* find out whether we have to add the controller or