]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api: fix segfault in cgroup_set_permissions()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 31 Jan 2023 18:30:21 +0000 (11:30 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 31 Jan 2023 18:30:25 +0000 (11:30 -0700)
commit34e98305dd2522a4cb5b5bfd59c9dbc53c5ef540
treea39f25c6ace11c5bbe4cb4b167afd542cc1f8107
parent974477a5405f1d58b16e95f1e240cc424969f53f
api: fix segfault in cgroup_set_permissions()

In cgroup_set_permissions(), we don't validate the cgroup and a NULL may
be passed to it in place of the cgroup, causing a segfault, when the
NULL pointer is dereferenced to set the permissions. This patch
introduces a check to validate the cgroup argument.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit 9795cdf9c18878388b9aa5c428c29eca8d6ad0a7)
src/api.c