Skip to content

Commit

Permalink
Fix potential out of bound access in PCPProcessTable_updateCmdline()
Browse files Browse the repository at this point in the history
Signed-off-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 committed Jan 23, 2025
1 parent f4bd894 commit 233c953
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pcp/PCPProcessTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 233c953

Please sign in to comment.