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.
This commit is contained in:
Christian Göttsche
2021-05-23 15:53:23 +02:00
committed by cgzones
parent 550a141860
commit c408add108
2 changed files with 8 additions and 1 deletions

View File

@ -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) {