diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:06 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:06 +0000 |
| commit | 8f3cadc28cb2bb9e8f9d69eeaaea1f57f2f7b2ab (patch) | |
| tree | 05a2b6ec297fe6283d9557c791445d1daf88dcd0 /lib/sanitizer_common/sanitizer_procmaps_solaris.cc | |
| parent | 63714eb5809e39666dec2454c354195e76f916ba (diff) | |
Vendor import of stripped compiler-rt trunk r366426 (just before the release_90vendor/compiler-rt/compiler-rt-trunk-r366426
branch point):
https://llvm.org/svn/llvm-project/compiler-rt/trunk@366426
Diffstat (limited to 'lib/sanitizer_common/sanitizer_procmaps_solaris.cc')
| -rw-r--r-- | lib/sanitizer_common/sanitizer_procmaps_solaris.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sanitizer_common/sanitizer_procmaps_solaris.cc b/lib/sanitizer_common/sanitizer_procmaps_solaris.cc index 49bb46c31b08..b5df6fe4c41e 100644 --- a/lib/sanitizer_common/sanitizer_procmaps_solaris.cc +++ b/lib/sanitizer_common/sanitizer_procmaps_solaris.cc @@ -1,7 +1,8 @@ //===-- sanitizer_procmaps_solaris.cc -------------------------------------===// // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -49,9 +50,11 @@ bool MemoryMappingLayout::Next(MemoryMappedSegment *segment) { segment->protection |= kProtectionExecute; if (segment->filename != NULL && segment->filename_size > 0) { - internal_snprintf(segment->filename, - Min(segment->filename_size, (uptr)PATH_MAX), "%s", + char proc_path[PATH_MAX + 1]; + + internal_snprintf(proc_path, sizeof(proc_path), "/proc/self/path/%s", xmapentry->pr_mapname); + internal_readlink(proc_path, segment->filename, segment->filename_size); } data_.current += sizeof(prxmap_t); |
