diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-05-23 15:53:23 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2021-05-25 18:20:09 +0200 |
commit | c408add10847c597de9fb7ba76295c386dc39649 (patch) | |
tree | a88bd96a98b61b785fe6595b47b074b6621663b4 /linux/LinuxProcessList.c | |
parent | 550a1418606f487941b3dddbf81de17c459db66c (diff) |
Linux: add reset to heuristic
On hard to parse command lines tokenStart might be computed to be bigger
than tokenEnd.
Reset both values in such cases.
Diffstat (limited to 'linux/LinuxProcessList.c')
-rw-r--r-- | linux/LinuxProcessList.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index e262ce7c..b89b76dd 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1123,6 +1123,13 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t proc } } } + + /* Some command lines are hard to parse, like + * file.so [kdeinit5] file local:/run/user/1000/klauncherdqbouY.1.slave-socket local:/run/user/1000/kded5TwsDAx.1.slave-socket + * Reset if start is behind end. + */ + if (tokenStart >= tokenEnd) + tokenStart = tokenEnd = 0; } if (tokenEnd == 0) { |