1 diff -up libcgroup-0.41/src/api.c.coverity libcgroup-0.41/src/api.c
2 --- libcgroup-0.41/src/api.c.coverity 2014-01-13 20:52:49.853838149 +0100
3 +++ libcgroup-0.41/src/api.c 2014-01-13 20:52:49.854838142 +0100
4 @@ -2791,7 +2791,6 @@ static int cgroup_create_template_group(
5 if (group_name == NULL) {
12 diff -up libcgroup-0.41/src/config.c.coverity libcgroup-0.41/src/config.c
13 --- libcgroup-0.41/src/config.c.coverity 2014-01-13 15:05:56.000000000 +0100
14 +++ libcgroup-0.41/src/config.c 2014-01-13 20:52:49.854838142 +0100
15 @@ -323,7 +323,7 @@ int config_group_task_perm(char *perm_ty
16 long val = atoi(value);
17 char buffer[CGROUP_BUFFER_LEN];
18 struct cgroup *config_cgroup;
20 + int table_index, ret;
24 @@ -367,10 +367,10 @@ int config_group_task_perm(char *perm_ty
26 goto group_task_error;
28 - getgrnam_r(value, group, buffer,
29 + ret = getgrnam_r(value, group, buffer,
30 CGROUP_BUFFER_LEN, &group_buffer);
32 - if (group_buffer == NULL) {
33 + if (ret != 0 || group_buffer == NULL) {
35 goto group_task_error;
37 @@ -436,7 +436,7 @@ int config_group_admin_perm(char *perm_t
38 struct cgroup *config_cgroup;
39 long val = atoi(value);
40 char buffer[CGROUP_BUFFER_LEN];
42 + int table_index, ret;
46 @@ -479,10 +479,10 @@ int config_group_admin_perm(char *perm_t
50 - getgrnam_r(value, group, buffer,
51 + ret = getgrnam_r(value, group, buffer,
52 CGROUP_BUFFER_LEN, &group_buffer);
54 - if (group_buffer == NULL) {
55 + if (ret != 0 || group_buffer == NULL) {
59 diff -up libcgroup-0.41/src/daemon/cgrulesengd.c.coverity libcgroup-0.41/src/daemon/cgrulesengd.c
60 --- libcgroup-0.41/src/daemon/cgrulesengd.c.coverity 2014-01-13 15:05:56.000000000 +0100
61 +++ libcgroup-0.41/src/daemon/cgrulesengd.c 2014-01-13 20:52:49.854838142 +0100
62 @@ -646,7 +646,7 @@ close:
64 static int cgre_create_netlink_socket_process_msg(void)
66 - int sk_nl = 0, sk_unix = 0, sk_max;
67 + int sk_nl = -1, sk_unix = -1, sk_max;
68 struct sockaddr_nl my_nla;
71 @@ -784,9 +784,9 @@ static int cgre_create_netlink_socket_pr
83 diff -upr libcgroup-0.40.rc1.orig/src/tools/lscgroup.c libcgroup-0.40.rc1/src/tools/lscgroup.c
84 --- libcgroup-0.40.rc1.orig/src/tools/lscgroup.c 2013-05-21 15:36:04.000000000 +0200
85 +++ libcgroup-0.40.rc1/src/tools/lscgroup.c 2013-11-04 14:26:53.400473523 +0100
86 @@ -97,11 +97,11 @@ static int display_controller_data(char
90 - strncpy(cgroup_dir_path, info.full_path, FILENAME_MAX);
91 + strncpy(cgroup_dir_path, info.full_path, FILENAME_MAX - 1);
92 /* remove problematic '/' characters from cgroup directory path*/
93 trim_filepath(cgroup_dir_path);
95 - strncpy(input_dir_path, input_path, FILENAME_MAX);
96 + strncpy(input_dir_path, input_path, FILENAME_MAX - 1);
98 /* remove problematic '/' characters from input directory path*/
99 trim_filepath(input_dir_path);