aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2018-02-07 18:27:25 +0000
committerYi Kong <yikong@google.com>2018-03-28 19:48:16 -0700
commitd2d5bdae89bcbfdd76b3c986d853ab90f2c26ceb (patch)
treeafc04337beef85f2003ccdcb7b818944c9db05de
parentc74e47c3229ee75b3d6db0f8adaf913256d2ab12 (diff)
downloadcompiler-rt-llvm-r316199.tar.gz
[asan] Fix filename size on linux platforms.llvm-r316199
This is a a fix for: https://bugs.llvm.org/show_bug.cgi?id=35996 Use filename limits from system headers to be synchronized with what LD_PRELOAD can handle. Differential Revision: https://reviews.llvm.org/D42900 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324496 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/asan/asan_linux.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
index c7c04af03..1c1174813 100644
--- a/lib/asan/asan_linux.cc
+++ b/lib/asan/asan_linux.cc
@@ -31,6 +31,7 @@
#include <sys/types.h>
#include <dlfcn.h>
#include <fcntl.h>
+#include <limits.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
@@ -200,7 +201,7 @@ void AsanCheckIncompatibleRT() {
// the functions in dynamic ASan runtime instead of the functions in
// system libraries, causing crashes later in ASan initialization.
MemoryMappingLayout proc_maps(/*cache_enabled*/true);
- char filename[128];
+ char filename[PATH_MAX];
MemoryMappedSegment segment(filename, sizeof(filename));
while (proc_maps.Next(&segment)) {
if (IsDynamicRTName(segment.filename)) {