summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgenii Stepanov <eugenis@google.com>2021-09-17 23:03:42 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-09-17 23:03:42 +0000
commite8cf69e0d39f636855d8b5ddbbbd9e73ea90eaa6 (patch)
tree507225054ea1c0685b0a3ade5a0afe343a9689e2
parente265ca9bbe6160c81fb8530e05d46e392fc950bd (diff)
parent064b8d1e94b1c4951ddcfeaa3705250ce5fef879 (diff)
downloadgtest_extras-e8cf69e0d39f636855d8b5ddbbbd9e73ea90eaa6.tar.gz
Fix stack-buffer-underflow in RunInIsolationMode. am: 46817ceaf3 am: 064b8d1e94
Original change: https://android-review.googlesource.com/c/platform/system/testing/gtest_extras/+/1830381 Change-Id: Ib105c73d59f56a8964334a182bf4c16ecbcf1eb8
-rw-r--r--IsolateMain.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/IsolateMain.cpp b/IsolateMain.cpp
index 6ef823d..980fb70 100644
--- a/IsolateMain.cpp
+++ b/IsolateMain.cpp
@@ -102,7 +102,7 @@ static bool RunInIsolationMode(std::vector<const char*>& args) {
pid_t ppid = getppid();
std::string exe_path = std::string("/proc/") + std::to_string(ppid) + "/exe";
char buf[PATH_MAX + 1];
- size_t len;
+ ssize_t len;
// NB We can't use things like android::base::* or std::filesystem::* due to linking
// issues.
// Since PATH_MAX is the longest a symlink can be in posix we don't need to