[PATCH] D31457: [asan] Add strndup/__strndup interceptors if targeting linux.
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 17 18:11:45 PDT 2017
vitalybuka 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:
> 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.
Repository:
rL LLVM
https://reviews.llvm.org/D31457
More information about the llvm-commits
mailing list