diff options
author | Hans Wennborg <hans@hanshq.net> | 2018-02-07 19:51:13 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2018-02-07 19:51:13 +0000 |
commit | 9d61c78bced84866cc886f1f1111c8e51c1d52d5 (patch) | |
tree | bdf059d1d73991f4ab9b00a8aff52363f9e42220 | |
parent | 32dfc401bb53cf439cb11b700c5e3322b349e8dc (diff) |
Merging r324496:llvm_60-amp-20180630release_60-f1b37feef3d-amp-20180630
------------------------------------------------------------------------
r324496 | yroux | 2018-02-07 19:27:25 +0100 (Wed, 07 Feb 2018) | 9 lines
[asan] Fix filename size on linux platforms.
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/branches/release_60@324506 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/asan/asan_linux.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc index 047e1dbb7..625f32d40 100644 --- a/lib/asan/asan_linux.cc +++ b/lib/asan/asan_linux.cc @@ -32,6 +32,7 @@ #include <sys/types.h> #include <dlfcn.h> #include <fcntl.h> +#include <limits.h> #include <pthread.h> #include <stdio.h> #include <unistd.h> @@ -214,7 +215,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)) { |