[PATCH] D11376: [sanitizer] Add a variant of "include" flag that does not abort on missing file and support process name substitution.

Alexey Samsonov vonosmas at gmail.com
Tue Jul 21 14:58:52 PDT 2015


samsonov added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_flags.cc:48
@@ -47,1 +47,3 @@
 
+static void SubstituteBinaryName(const char *s, char *out) {
+  char *t = out;
----------------
Add a comment that `out` should be at least `kMaxPathLength`. Also, you don't seem to actually trim `s` to this. constant if necessary. Consider using `InternalScopedString *out` and `out->append()` instead.

================
Comment at: lib/sanitizer_common/sanitizer_flags.cc:55
@@ +54,3 @@
+    internal_strncpy(t, base, kMaxPathLength - (t - out));
+    t += internal_strlen(base);
+    s += 2;
----------------
if `base` was trimmed, you would advance pointer `t` too far, and may make an out-of-bound write on the next iteration.


http://reviews.llvm.org/D11376







More information about the llvm-commits mailing list