[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 01:37:44 PST 2018


yroux created this revision.
Herald added subscribers: Sanitizers, llvm-commits, kubamracek.

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.

Passed regression tests on x86_64 without regressions.


Repository:
  rCRT Compiler Runtime

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
@@ -26,6 +26,7 @@
 #include "sanitizer_common/sanitizer_procmaps.h"
 
 #include <sys/time.h>
+#include <sys/param.h>
 #include <sys/resource.h>
 #include <sys/mman.h>
 #include <sys/syscall.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[MAXPATHLEN];
       MemoryMappedSegment segment(filename, sizeof(filename));
       while (proc_maps.Next(&segment)) {
         if (IsDynamicRTName(segment.filename)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42900.132791.patch
Type: text/x-patch
Size: 793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180205/3d2807d6/attachment.bin>


More information about the llvm-commits mailing list