[PATCH] D42900: [asan] Fix filename size on linux platforms.

Yvan Roux via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 23:10:13 PST 2018


yroux updated this revision to Diff 132939.
yroux added a comment.

Use PATH_MAX from <limits.h> instead of MAXPATHLEN.


https://reviews.llvm.org/D42900

Files:
  lib/asan/asan_linux.cc


Index: lib/asan/asan_linux.cc
===================================================================
--- lib/asan/asan_linux.cc
+++ 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 @@
       // 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)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42900.132939.patch
Type: text/x-patch
Size: 764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180206/fb87ab45/attachment.bin>


More information about the llvm-commits mailing list