[PATCH] D43539: Add new interceptors: getttyent(3) family

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 25 14:09:41 PST 2018


vitalybuka accepted this revision.
vitalybuka added a comment.
This revision is now accepted and ready to land.

LGTM if you address my comments



================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:6844
+  COMMON_INTERCEPTOR_ENTER(ctx, getttyent);
+  ttyent = REAL(getttyent)();
+  if (ttyent) {
----------------
struct __sanitizer_ttyent *ttyent = REAL...
here and below


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:6845
+  ttyent = REAL(getttyent)();
+  if (ttyent) {
+    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ttyent, struct_ttyent_sz);
----------------
please no brackets here  and below


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:6862
+}
+INTERCEPTOR(int, setttyent) {
+  void *ctx;
----------------
it does not check anything, why do you want to intercept it?
same for endttyent


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7121
 
 #if SANITIZER_NETBSD
   COMMON_INTERCEPT_FUNCTION(__libc_mutex_lock);
----------------
Could you please convert this peace into INIT_ style?
As a separate patch.
Trivial but I can't be sure that it compiles if I do it myself.


================
Comment at: test/sanitizer_common/TestCases/NetBSD/getttyent.cc:5
+#include <stdlib.h>
+#include <ttyent.h>
+
----------------
maybe ttyent.cc  is better name
same for INIT_GETTTYENT->INIT_TTYENT


Repository:
  rL LLVM

https://reviews.llvm.org/D43539





More information about the llvm-commits mailing list