]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
tests: Fix test failure on Fedora 30 5/head
authorTom Hromatka <tom.hromatka@oracle.com>
Mon, 13 Jan 2020 23:34:56 +0000 (23:34 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 13 Jan 2020 23:34:56 +0000 (23:34 +0000)
Unit test 004-cgroup_compare_ignore_rule.cpp segfaults on
test CgroupCompareIgnoreRuleTest.CombinedControllers().  This
is due to rule.procname being uninitialized.  This commit
initializes the entire rule structure to zero.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
tests/gunit/004-cgroup_compare_ignore_rule.cpp

index 2f585ab9b70f0e6fed86f03bfbe32995046e1286..29341f280ee0448bc536ed77e74e6ef0db6bccd8 100644 (file)
@@ -117,7 +117,7 @@ TEST_F(CgroupCompareIgnoreRuleTest, CombinedControllers)
                "13:cpu,cpuacct:/containercg";
        char rule_controller[] = "cpuacct";
        char procname[] = "docker";
-       struct cgroup_rule rule;
+       struct cgroup_rule rule = {0};
        pid_t pid = 6789;
        bool ret;