diff options
author | 2022-06-02 21:32:03 -0400 | |
---|---|---|
committer | 2022-06-02 21:32:03 -0400 | |
commit | 46618df409dc1b2499bd5c43820db70d4ff8778b (patch) | |
tree | 5e35a77fba57399d6c10861c623fc50a6d7aeed2 /src/lib | |
parent | firemon rework (diff) | |
download | firejail-46618df409dc1b2499bd5c43820db70d4ff8778b.tar.gz firejail-46618df409dc1b2499bd5c43820db70d4ff8778b.tar.zst firejail-46618df409dc1b2499bd5c43820db70d4ff8778b.zip |
fixes
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/pid.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/pid.c b/src/lib/pid.c index 8b2a9b0f5..5e9b20c94 100644 --- a/src/lib/pid.c +++ b/src/lib/pid.c | |||
@@ -74,8 +74,14 @@ void pid_get_cpu_time(unsigned pid, unsigned *utime, unsigned *stime) { | |||
74 | if (fgets(line, PIDS_BUFLEN - 1, fp)) { | 74 | if (fgets(line, PIDS_BUFLEN - 1, fp)) { |
75 | char *ptr = line; | 75 | char *ptr = line; |
76 | // jump 13 fields | 76 | // jump 13 fields |
77 | |||
78 | // end of comm string | ||
79 | ptr = strchr(ptr, ')'); | ||
80 | if (ptr == NULL) | ||
81 | goto myexit; | ||
82 | |||
77 | int i; | 83 | int i; |
78 | for (i = 0; i < 13; i++) { | 84 | for (i = 0; i < 11; i++) { |
79 | while (*ptr != ' ' && *ptr != '\t' && *ptr != '\0') | 85 | while (*ptr != ' ' && *ptr != '\t' && *ptr != '\0') |
80 | ptr++; | 86 | ptr++; |
81 | if (*ptr == '\0') | 87 | if (*ptr == '\0') |