From c408add10847c597de9fb7ba76295c386dc39649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 23 May 2021 15:53:23 +0200 Subject: 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. --- linux/LinuxProcessList.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'linux/LinuxProcessList.c') 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) { -- cgit v1.2.3