diff --git a/pcp/PCPProcessTable.c b/pcp/PCPProcessTable.c index 4999bdc27..d6d7bad95 100644 --- a/pcp/PCPProcessTable.c +++ b/pcp/PCPProcessTable.c @@ -316,7 +316,7 @@ static void PCPProcessTable_updateCmdline(Process* process, int pid, int offset, } else { ++command; --length; - if (command[length - 1] == ')') + if (length > 0 && command[length - 1] == ')') command[--length] = '\0'; process->isKernelThread = true; }