cgroup_create_template_group procedure writes to the first place of string of characters even if the varible points to NULL. As the result templates crashes. See http://sourceforge.net/mailarchive/forum.php?thread_name=khtfkj%24c8l%241%40ger.gmane.org&forum_name=libcg-devel
Signed-off-by: Ivana Hutarova Varekova <varek...@redhat.com> --- src/api.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api.c b/src/api.c index 4057945..ee18797 100644 --- a/src/api.c +++ b/src/api.c @@ -2843,9 +2843,9 @@ static int cgroup_create_template_group(char *orig_group_name, } while_end: - if (template_position[0] == '\0') + if ((template_position != NULL ) && (template_position[0] == '\0')) template_position[0] = '/'; - if (group_position[0] == '\0') + if ((group_position != NULL) && (group_position[0] == '\0')) group_position[0] = '/'; end: ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel