[compiler-rt] r325207 - Prevent recursive MSan interceptors in fgets(3)
Kamil Rytarowski via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 18:47:36 PST 2018
Author: kamil
Date: Wed Feb 14 18:47:35 2018
New Revision: 325207
URL: http://llvm.org/viewvc/llvm-project?rev=325207&view=rev
Log:
Prevent recursive MSan interceptors in fgets(3)
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/D42884
Modified:
compiler-rt/trunk/lib/msan/msan_interceptors.cc
Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=325207&r1=325206&r2=325207&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Wed Feb 14 18:47:35 2018
@@ -779,6 +779,7 @@ INTERCEPTOR(int, socketpair, int domain,
INTERCEPTOR(char *, fgets, char *s, int size, void *stream) {
ENSURE_MSAN_INITED();
+ InterceptorScope interceptor_scope;
char *res = REAL(fgets)(s, size, stream);
if (res)
__msan_unpoison(s, REAL(strlen)(s) + 1);
More information about the llvm-commits
mailing list