Commit 763c777b by Serge Hallyn Committed by Stéphane Graber

prune_init_cgroup: don't dereference NULL

parent d529ba02
......@@ -177,7 +177,12 @@ void cgroup_disconnect(void)
#define INIT_SCOPE "/init.scope"
void prune_init_scope(char *cg)
{
char *point = cg + strlen(cg) - strlen(INIT_SCOPE);
char *point;
if (!cg)
return;
point = cg + strlen(cg) - strlen(INIT_SCOPE);
if (point < cg)
return;
if (strcmp(point, INIT_SCOPE) == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment