[compiler-rt] r324496 - [asan] Fix filename size on linux platforms.
Yvan Roux via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 10:27:25 PST 2018
Author: yroux
Date: Wed Feb 7 10:27:25 2018
New Revision: 324496
URL: http://llvm.org/viewvc/llvm-project?rev=324496&view=rev
Log:
[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
Modified:
compiler-rt/trunk/lib/asan/asan_linux.cc
Modified: compiler-rt/trunk/lib/asan/asan_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_linux.cc?rev=324496&r1=324495&r2=324496&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_linux.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_linux.cc Wed Feb 7 10:27:25 2018
@@ -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)) {
More information about the llvm-commits
mailing list