From dde2af1fdba9ce3b59b4f3386ec2c0664373cb94 Mon Sep 17 00:00:00 2001 From: Narendran Gopalakrishnan Date: Mon, 9 Nov 2020 18:42:24 +0100 Subject: [PATCH] Assume full basename matches COMM when matching full COMM buffer --- linux/LinuxProcess.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index c9828065..cedc2162 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -240,8 +240,7 @@ static bool findCommInCmdline(const char *comm, const char *cmdline, int cmdline } tokenLen = token - tokenBase; - if (((commLen < (TASK_COMM_LEN - 1) && tokenLen == commLen) || - (commLen == (TASK_COMM_LEN - 1) && tokenLen >= commLen)) && + if ((tokenLen == commLen || (tokenLen > commLen && commLen == (TASK_COMM_LEN - 1))) && strncmp(tokenBase, comm, commLen) == 0) { *pCommStart = tokenBase - cmdline; *pCommEnd = token - cmdline;