[PATCH] D54584: Add new interceptor for regex(3) in NetBSD

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 19 12:47:35 PST 2018


vitalybuka added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7298
+  SIZE_T res = REAL(regerror)(errcode, preg, errbuf, errbuf_size);
+  if (errbuf)
+    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, errbuf, REAL(strlen)(errbuf) + 1);
----------------
if REAL failed, string may be not null terminated, so strlen will crash


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7315
+    COMMON_INTERCEPTOR_READ_RANGE(ctx, sub, REAL(strlen)(sub) + 1);
+  // The implementation demands and hardcodes 10 elements
+  if (rm)
----------------
I can't find documentation for regnsub


Repository:
  rL LLVM

https://reviews.llvm.org/D54584





More information about the llvm-commits mailing list