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; }