Filter leading colons in CGROUP name

This commit is contained in:
Benny Baumann 2021-11-06 17:20:37 +01:00 committed by BenBE
parent 1c3c149d20
commit ea4282784d
1 changed files with 10 additions and 3 deletions

View File

@ -872,9 +872,16 @@ static void LinuxProcessList_readCGroupFile(LinuxProcess* process, openat_arg_t
if (!ok) if (!ok)
break; break;
char* group = strchr(buffer, ':'); char* group = buffer;
if (!group) for (size_t i = 0; i < 2; i++) {
break; group = strchrnul(group, ':');
if (!*group)
break;
group++;
}
char* eol = strchrnul(group, '\n');
*eol = '\0';
if (at != output) { if (at != output) {
*at = ';'; *at = ';';