summaryrefslogtreecommitdiff
path: root/alloc-stress/alloc-stress.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alloc-stress/alloc-stress.cpp')
-rw-r--r--alloc-stress/alloc-stress.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/alloc-stress/alloc-stress.cpp b/alloc-stress/alloc-stress.cpp
index fcb074b6..1cd8fddf 100644
--- a/alloc-stress/alloc-stress.cpp
+++ b/alloc-stress/alloc-stress.cpp
@@ -124,6 +124,9 @@ pid_t createProcess(Pipe pipe, const char *exName,
ssize_t exPathLen = readlink("/proc/self/exe", exPath, sizeof(exPath));
bool isExPathAvailable =
exPathLen != -1 && exPathLen < static_cast<ssize_t>(sizeof(exPath));
+ if (isExPathAvailable) {
+ exPath[exPathLen] = '\0';
+ }
execl(isExPathAvailable ? exPath : exName, exName, "--worker", arg, readFdStr, writeFdStr,
use_memcg ? "1" : "0", nullptr);
ASSERT_TRUE(0);