diff options
author | Kamil Rytarowski <n54@gmx.com> | 2018-02-15 02:48:20 +0000 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2018-02-15 02:48:20 +0000 |
commit | 9719bd128ff69842df6cceafe6f0920cf393f33c (patch) | |
tree | 215bfce268a59a2ec53e8c13ca659a70c00349eb | |
parent | cff1a203ec4663dfd396509c6bf2151df4937e35 (diff) |
Prevent recursive MSan interceptors in strftime(3) like functions
Summary:
This corrects intercepting this call on NetBSD without false positives.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, eugenis, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42883
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325208 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/msan/msan_interceptors.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/msan/msan_interceptors.cc b/lib/msan/msan_interceptors.cc index c99fb9562..43a2bdcf6 100644 --- a/lib/msan/msan_interceptors.cc +++ b/lib/msan/msan_interceptors.cc @@ -514,6 +514,7 @@ INTERCEPTOR(SIZE_T, __strxfrm_l, char *dest, const char *src, SIZE_T n, #define INTERCEPTOR_STRFTIME_BODY(char_type, ret_type, func, s, ...) \ ENSURE_MSAN_INITED(); \ + InterceptorScope interceptor_scope; \ ret_type res = REAL(func)(s, __VA_ARGS__); \ if (s) __msan_unpoison(s, sizeof(char_type) * (res + 1)); \ return res; |