]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
cgcreate: fix null pointer dereference in create_systemd_scope()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 21 Jun 2023 04:16:20 +0000 (09:46 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 21 Jun 2023 16:21:46 +0000 (10:21 -0600)
commitf740b9bf8898b25992c5b9acbb880e1e78a665b6
treebf7810189fd25597364fdf0620e3c7e3026603d5
parentc719d9c858c5f9abc3be8ad00aff5571e2834a71
cgcreate: fix null pointer dereference in create_systemd_scope()

Fix a NULL pointer dereference, reported by the Coverity tool:

CID 321267 (#1 of 1): Dereference null return value (NULL_RETURNS)6.
dereference: Dereferencing a pointer that might be NULL scope when
calling strlen.

check for the return value from strstr(), before dereferencing it.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/cgcreate.c