From 299bc7468fb73c234fcbfca8981073dc76044007 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 8 May 2024 09:53:07 +0800 Subject: [PATCH] Terminal (Linux): fix exePath detection --- src/detection/terminalshell/terminalshell_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index b2ad822dd..dbdc08900 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -46,7 +46,7 @@ static void getProcessInformation(pid_t pid, FFstrbuf* processName, FFstrbuf* ex ssize_t length = readlink(filePath, exePath->chars, exePath->allocated - 1); if (length > 0) // doesn't contain trailing NUL { - exePath->chars[length + 1] = '\0'; + exePath->chars[length] = '\0'; exePath->length = (uint32_t) length; }