This is an archive of the discontinued LLVM Phabricator instance.

[msan] Intercept wcscat, wcsncat.
ClosedPublic

Authored by eugenis on Jun 26 2017, 5:14 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis created this revision.Jun 26 2017, 5:14 PM
vitalybuka edited edge metadata.Jun 26 2017, 5:34 PM

Why strncat is not in common?

compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
6215 ↗(On Diff #104048)

you need to handle strict_string_checks
Probably new macro COMMON_INTERCEPTOR_READ_WSTRING is needed

6243 ↗(On Diff #104048)

COMMON_INTERCEPTOR_READ_WSTRING

vitalybuka accepted this revision.Jun 27 2017, 2:42 PM
vitalybuka added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
6215 ↗(On Diff #104048)

Discussed offline. It's not needed here.

This revision is now accepted and ready to land.Jun 27 2017, 2:42 PM
eugenis added inline comments.Jun 27 2017, 3:01 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
6215 ↗(On Diff #104048)

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.

This revision was automatically updated to reflect the committed changes.