diff options
author | Benny Baumann <BenBE@geshi.org> | 2021-02-01 22:09:39 +0100 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2021-02-01 22:09:39 +0100 |
commit | 12208af7773775bf637ee2f8a07fdd6300238fc1 (patch) | |
tree | aeecc7777f7d9d56bfb01ae8e9cbd96d164e0b76 /linux/LinuxProcess.c | |
parent | 12f5f06e8855b653c98b75de55a45098bb468d57 (diff) |
DiD: Avoid negative cmdlineBasenameOffset
Diffstat (limited to 'linux/LinuxProcess.c')
-rw-r--r-- | linux/LinuxProcess.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index df9958d8..2cc02033 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -202,6 +202,9 @@ static bool findCommInCmdline(const char *comm, const char *cmdline, int cmdline size_t tokenLen; const size_t commLen = strlen(comm); + if (cmdlineBasenameOffset < 0) + return false; + for (const char *token = cmdline + cmdlineBasenameOffset; *token; ) { for (tokenBase = token; *token && *token != '\n'; ++token) { if (*token == '/') { |