]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
cgget: Fix segfault when no flags provided 40/head
authorTom Hromatka <tom.hromatka@oracle.com>
Wed, 14 Apr 2021 16:02:44 +0000 (10:02 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 19 Apr 2021 14:17:33 +0000 (08:17 -0600)
commitbaf16415670e24cef73aecefacbfc343a54ca764
treeed99d478cdfca718ac9477747786b5ac8b5d50cd
parent11a38f7b59750aa60d667afbe81b78ad852e25cb
cgget: Fix segfault when no flags provided

Fix a segmentation fault when cgget is invoked in the
following form:
cgget CroupName

parse_opt_args() was erroneously expecting a previously
populated struct cgroup in this case, and we were indexing
out of bounds of the cg_list.

Fixes: 1b7d606fa12a ("cgget: Major refactor")
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/cgget.c