[PATCH] D31457: [asan] Add strndup/__strndup interceptors if targeting linux.

pierre gousseau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 02:37:33 PDT 2017


pgousseau added inline comments.


================
Comment at: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc:233
+  if (common_flags()->intercept_strndup) {                                     \
+    COMMON_INTERCEPTOR_READ_RANGE(ctx, s, copy_length + 1);                    \
+  }                                                                            \
----------------
vitalybuka wrote:
> vitalybuka wrote:
> > must be "COMMON_INTERCEPTOR_READ_RANGE(ctx, s, Min(copy_length + 1, size));  "
> > 
> > (copy_length + 1) is a problem if "s" is not zero terminated
> I am going to extend test and create a patch for this.
Makes sense yes thanks! Now that this has been reverted in rL303324, do you still plan on making a patch for it?


Repository:
  rL LLVM

https://reviews.llvm.org/D31457





More information about the llvm-commits mailing list