mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
DiD: Avoid negative cmdlineBasenameOffset
This commit is contained in:
parent
12f5f06e88
commit
12208af777
@ -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 == '/') {
|
||||
|
Loading…
Reference in New Issue
Block a user