diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index 1366ae686..02a86baa9 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -86,7 +86,7 @@ static void getProcessInformation(pid_t pid, FFstrbuf* processName, FFstrbuf* ex args, &size, NULL, 0 ) == 0) - ffStrbufSetS(exePath, args); + ffStrbufSetNS(exePath, (uint32_t) (size - 1), args); size = ARG_MAX; if(sysctl( diff --git a/src/util/platform/FFPlatform_unix.c b/src/util/platform/FFPlatform_unix.c index f224c84eb..7500261a4 100644 --- a/src/util/platform/FFPlatform_unix.c +++ b/src/util/platform/FFPlatform_unix.c @@ -33,7 +33,7 @@ static void getExePath(FFPlatform* platform) exePathLen = 0; #endif if (exePathLen > 0) - exePath->length = (uint32_t) exePathLen; + exePath->length = (uint32_t) (exePathLen - 1); } static void platformPathAddEnv(FFlist* dirs, const char* env)