diff options
author | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2008-06-11 08:20:54 +0000 |
---|---|---|
committer | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2008-06-11 08:20:54 +0000 |
commit | f00b82b6f9114694e3c05e2bb3a5395ce59c85de (patch) | |
tree | 2641e9182cf80d8c080299ff2992d314e2929be0 /wrapper.c | |
parent | f1bce06975c0c4d6b1e348bbd1cbc26694e57f82 (diff) | |
download | libcg-f00b82b6f9114694e3c05e2bb3a5395ce59c85de.tar.gz libcg-f00b82b6f9114694e3c05e2bb3a5395ce59c85de.tar.xz libcg-f00b82b6f9114694e3c05e2bb3a5395ce59c85de.zip |
libcgroup: Fix segmentation fault in APIs.
Dan Smith reported some segmentation faults. It turns out that we did
not NULL terminate all the structures when we had moved to the wrapper
based approach. With this in mind, the loop checks the index instead
of a NULL structure.
Also remove unwanted NULL terminations.
Thanks to Dan for excellent debugging.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/tags/v0.1c@77 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'wrapper.c')
-rw-r--r-- | wrapper.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -37,7 +37,6 @@ struct cgroup *cgroup_new_cgroup(const char *name, uid_t tasks_uid, cgroup->control_uid = control_uid; cgroup->control_gid = control_gid; cgroup->index = 0; - cgroup->controller[cgroup->index] = NULL; return cgroup; } @@ -71,7 +70,6 @@ struct cgroup_controller *cgroup_add_controller(struct cgroup *cgroup, strncpy(controller->name, name, sizeof(controller->name)); controller->index = 0; - controller->values[controller->index] = NULL; cgroup->controller[cgroup->index] = controller; cgroup->index++; |