[PATCH] Sanitize printf functions

Kostya Serebryany kcc at google.com
Sat Dec 28 01:37:27 PST 2013


  Let others look at this change too.
  We won't commit it before the end of our holidays (~Jan 10) anyway.

  Until we don't have tsan tests, I suggest to disable this for tsan.


================
Comment at: sanitizer_common/sanitizer_common_interceptors.inc:33
@@ -32,2 +32,3 @@
 
+#include <stddef.h>
 #include <stdarg.h>
----------------
Evgeniy Stepanov wrote:
> No system includes (stdarg is a necessary evil).
can you avoid this? 

================
Comment at: msan/msan_interceptors.cc:1294
@@ -1293,1 +1293,3 @@
 #define COMMON_INTERCEPTOR_ON_EXIT(ctx) OnExit()
+// TODO(ygribov): update Msan to use common printf interceptors
+#define SANITIZER_INTERCEPT_PRINTF 0
----------------
we can do it as a separate commit (I'd even prefer that)

================
Comment at: sanitizer_common/sanitizer_common_interceptors_scanf.inc:281
@@ -280,1 +280,3 @@
 
+  // TODO(y.gribov): check format?
+
----------------
good idea. feel free to implement or to leave the TODO.
Actually this code base uses FIXME (w/o name) more often. 


http://llvm-reviews.chandlerc.com/D2480



More information about the llvm-commits mailing list