DiD: Avoid negative cmdlineBasenameOffset

This commit is contained in:
Benny Baumann 2021-02-01 22:09:39 +01:00
parent 12f5f06e88
commit 12208af777
1 changed files with 3 additions and 0 deletions

View File

@ -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 == '/') {