summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-05-09 07:26:51 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-05-09 07:26:51 +0000
commitd6426fc51f500bd7708714c631ea6d28db635ce4 (patch)
treec853ccc0e8e1ee6ff2c8a4f969fe6ccdfb888da1
parentbcdc3ad671a98f5dfb21ec5985b57c146cbbeabb (diff)
parent34b5ed247cf41ff9889a9e9c3a413e017e690f58 (diff)
downloadextras-d6426fc51f500bd7708714c631ea6d28db635ce4.tar.gz
Snap for 4770446 from 34b5ed247cf41ff9889a9e9c3a413e017e690f58 to pi-release
Change-Id: Ib2efb29b68a13828199cc0840789af02b9edcee6
-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);