summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2021-11-06 17:20:37 +0100
committerBenBE <BenBE@geshi.org>2021-11-28 20:19:10 +0100
commitea4282784de0a74fa97d9ca917f7f601c16aab64 (patch)
tree6a4b02fd7b1ac10eada8f34629f2101a0da66600
parent1c3c149d20c3aa7da1116bdd2545eadaea4d1a67 (diff)
Filter leading colons in CGROUP name
-rw-r--r--linux/LinuxProcessList.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index a2d3d2be..6b9f988f 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -872,9 +872,16 @@ static void LinuxProcessList_readCGroupFile(LinuxProcess* process, openat_arg_t
if (!ok)
break;
- char* group = strchr(buffer, ':');
- if (!group)
- break;
+ char* group = buffer;
+ for (size_t i = 0; i < 2; i++) {
+ group = strchrnul(group, ':');
+ if (!*group)
+ break;
+ group++;
+ }
+
+ char* eol = strchrnul(group, '\n');
+ *eol = '\0';
if (at != output) {
*at = ';';

© 2014-2024 Faster IT GmbH | imprint | privacy policy