[PATCH] D34656: [msan] Intercept wcscat, wcsncat.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 15:01:22 PDT 2017


eugenis added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:6215
+  SIZE_T res = REAL(wcsnlen)(s, n);
+  COMMON_INTERCEPTOR_READ_RANGE(ctx, s, sizeof(wchar_t) * Min(res + 1, n));
+  return res;
----------------
vitalybuka wrote:
> vitalybuka wrote:
> > you need to handle strict_string_checks
> > Probably new macro COMMON_INTERCEPTOR_READ_WSTRING is needed
> Discussed offline. It's not needed here.
Right. To add some context, strict_string_checks covers the case when a string function is allowed to peek at the entire string, but does not really need to - as in strchr() finding the character close to the start of the string. This is not the case with wcscat / wcsncat which always need to read the entire string or the first N bytes of it.



https://reviews.llvm.org/D34656





More information about the llvm-commits mailing list