[compiler-rt] Remove some cpplint filters

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371704 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/fuzzer/FuzzedDataProvider.h b/include/fuzzer/FuzzedDataProvider.h
index 428db9a..fd895b7 100644
--- a/include/fuzzer/FuzzedDataProvider.h
+++ b/include/fuzzer/FuzzedDataProvider.h
@@ -284,9 +284,9 @@
 
     // Avoid using implementation-defined unsigned to signer conversions.
     // To learn more, see https://stackoverflow.com/questions/13150449.
-    if (value <= std::numeric_limits<TS>::max())
+    if (value <= std::numeric_limits<TS>::max()) {
       return static_cast<TS>(value);
-    else {
+    } else {
       constexpr auto TS_min = std::numeric_limits<TS>::min();
       return TS_min + static_cast<char>(value - TS_min);
     }
diff --git a/lib/asan/asan_malloc_win.cpp b/lib/asan/asan_malloc_win.cpp
index 9d107be..13c6f65 100644
--- a/lib/asan/asan_malloc_win.cpp
+++ b/lib/asan/asan_malloc_win.cpp
@@ -528,10 +528,11 @@
                                      (uptr)WRAP(RtlAllocateHeap),
                                      (uptr *)&REAL(RtlAllocateHeap));
   } else {
-#define INTERCEPT_UCRT_FUNCTION(func)                                         \
-  if (!INTERCEPT_FUNCTION_DLLIMPORT("ucrtbase.dll",                           \
-                                    "api-ms-win-core-heap-l1-1-0.dll", func)) \
-    VPrintf(2, "Failed to intercept ucrtbase.dll import %s\n", #func);
+#define INTERCEPT_UCRT_FUNCTION(func)                                  \
+  if (!INTERCEPT_FUNCTION_DLLIMPORT(                                   \
+          "ucrtbase.dll", "api-ms-win-core-heap-l1-1-0.dll", func)) {  \
+    VPrintf(2, "Failed to intercept ucrtbase.dll import %s\n", #func); \
+  }
     INTERCEPT_UCRT_FUNCTION(HeapAlloc);
     INTERCEPT_UCRT_FUNCTION(HeapFree);
     INTERCEPT_UCRT_FUNCTION(HeapReAlloc);
diff --git a/lib/asan/asan_report.cpp b/lib/asan/asan_report.cpp
index 5c16cb3..2e6ce43 100644
--- a/lib/asan/asan_report.cpp
+++ b/lib/asan/asan_report.cpp
@@ -410,8 +410,12 @@
 
 static INLINE void CheckForInvalidPointerPair(void *p1, void *p2) {
   switch (flags()->detect_invalid_pointer_pairs) {
-    case 0 : return;
-    case 1 : if (p1 == nullptr || p2 == nullptr) return; break;
+    case 0:
+      return;
+    case 1:
+      if (p1 == nullptr || p2 == nullptr)
+        return;
+      break;
   }
 
   uptr a1 = reinterpret_cast<uptr>(p1);
diff --git a/lib/asan/asan_rtems.cpp b/lib/asan/asan_rtems.cpp
index 360d578..ecd568c 100644
--- a/lib/asan/asan_rtems.cpp
+++ b/lib/asan/asan_rtems.cpp
@@ -181,11 +181,11 @@
       asanThreadRegistry().GetThreadLocked(thread->tid())->status;
   DCHECK(status == ThreadStatusCreated || status == ThreadStatusRunning);
   // Determine whether we are starting or restarting the thread.
-  if (status == ThreadStatusCreated)
+  if (status == ThreadStatusCreated) {
     // In lieu of AsanThread::ThreadStart.
     asanThreadRegistry().StartThread(thread->tid(), os_id, ThreadType::Regular,
                                      nullptr);
-  else {
+  } else {
     // In a thread restart, a thread may resume execution at an
     // arbitrary function entry point, with its stack and TLS state
     // reset.  We unpoison the stack in that case.
diff --git a/lib/asan/asan_scariness_score.h b/lib/asan/asan_scariness_score.h
index 9e7ba47..3932973 100644
--- a/lib/asan/asan_scariness_score.h
+++ b/lib/asan/asan_scariness_score.h
@@ -43,7 +43,7 @@
       internal_strlcat(descr, "-", sizeof(descr));
     internal_strlcat(descr, reason, sizeof(descr));
     score += add_to_score;
-  };
+  }
   int GetScore() const { return score; }
   const char *GetDescription() const { return descr; }
   void Print() const {
diff --git a/lib/asan/asan_thread.cpp b/lib/asan/asan_thread.cpp
index c75cdc2..6734d9a 100644
--- a/lib/asan/asan_thread.cpp
+++ b/lib/asan/asan_thread.cpp
@@ -367,8 +367,9 @@
   } else if (has_fake_stack()) {
     bottom = fake_stack()->AddrIsInFakeStack(addr);
     CHECK(bottom);
-  } else
+  } else {
     return 0;
+  }
 
   uptr aligned_addr = RoundDownTo(addr, SANITIZER_WORDSIZE / 8);  // align addr.
   u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr);
diff --git a/lib/dfsan/dfsan.h b/lib/dfsan/dfsan.h
index df6847c..d662391 100644
--- a/lib/dfsan/dfsan.h
+++ b/lib/dfsan/dfsan.h
@@ -38,7 +38,7 @@
 }  // extern "C"
 
 template <typename T>
-void dfsan_set_label(dfsan_label label, T &data) {
+void dfsan_set_label(dfsan_label label, T &data) {  // NOLINT
   dfsan_set_label(label, (void *)&data, sizeof(T));
 }
 
diff --git a/lib/dfsan/dfsan_custom.cpp b/lib/dfsan/dfsan_custom.cpp
index 78d12d7..84f0271 100644
--- a/lib/dfsan/dfsan_custom.cpp
+++ b/lib/dfsan/dfsan_custom.cpp
@@ -505,7 +505,7 @@
 SANITIZER_INTERFACE_ATTRIBUTE
 char *__dfsw_strcpy(char *dest, const char *src, dfsan_label dst_label,
                     dfsan_label src_label, dfsan_label *ret_label) {
-  char *ret = strcpy(dest, src);
+  char *ret = strcpy(dest, src);  // NOLINT
   if (ret) {
     internal_memcpy(shadow_for(dest), shadow_for(src),
                     sizeof(dfsan_label) * (strlen(src) + 1));
diff --git a/lib/interception/interception_win.cpp b/lib/interception/interception_win.cpp
index b94e214..1a1c327 100644
--- a/lib/interception/interception_win.cpp
+++ b/lib/interception/interception_win.cpp
@@ -883,8 +883,8 @@
   // Check that the module header is full and present.
   RVAPtr<IMAGE_DOS_HEADER> dos_stub(module, 0);
   RVAPtr<IMAGE_NT_HEADERS> headers(module, dos_stub->e_lfanew);
-  if (!module || dos_stub->e_magic != IMAGE_DOS_SIGNATURE || // "MZ"
-      headers->Signature != IMAGE_NT_SIGNATURE ||           // "PE\0\0"
+  if (!module || dos_stub->e_magic != IMAGE_DOS_SIGNATURE ||  // "MZ"
+      headers->Signature != IMAGE_NT_SIGNATURE ||             // "PE\0\0"
       headers->FileHeader.SizeOfOptionalHeader <
           sizeof(IMAGE_OPTIONAL_HEADER)) {
     return 0;
@@ -963,8 +963,8 @@
   // Check that the module header is full and present.
   RVAPtr<IMAGE_DOS_HEADER> dos_stub(module, 0);
   RVAPtr<IMAGE_NT_HEADERS> headers(module, dos_stub->e_lfanew);
-  if (!module || dos_stub->e_magic != IMAGE_DOS_SIGNATURE || // "MZ"
-      headers->Signature != IMAGE_NT_SIGNATURE ||            // "PE\0\0"
+  if (!module || dos_stub->e_magic != IMAGE_DOS_SIGNATURE ||  // "MZ"
+      headers->Signature != IMAGE_NT_SIGNATURE ||             // "PE\0\0"
       headers->FileHeader.SizeOfOptionalHeader <
           sizeof(IMAGE_OPTIONAL_HEADER)) {
     return false;
diff --git a/lib/lsan/lsan_common.cpp b/lib/lsan/lsan_common.cpp
index 529daee..86bd120 100644
--- a/lib/lsan/lsan_common.cpp
+++ b/lib/lsan/lsan_common.cpp
@@ -535,7 +535,7 @@
     if (i >= suspended_threads.size() || suspended_threads[i] != tctx->os_id)
       Report("Running thread %d was not suspended. False leaks are possible.\n",
              tctx->os_id);
-  };
+  }
 }
 
 static void ReportUnsuspendedThreads(
diff --git a/lib/msan/msan.h b/lib/msan/msan.h
index b2bc14f..12aeaa4 100644
--- a/lib/msan/msan.h
+++ b/lib/msan/msan.h
@@ -346,10 +346,11 @@
 #define GET_STORE_STACK_TRACE \
   GET_STORE_STACK_TRACE_PC_BP(StackTrace::GetCurrentPc(), GET_CURRENT_FRAME())
 
-#define GET_FATAL_STACK_TRACE_PC_BP(pc, bp)              \
-  BufferedStackTrace stack;                              \
-  if (msan_inited)                                       \
-    stack.Unwind(pc, bp, nullptr, common_flags()->fast_unwind_on_fatal)
+#define GET_FATAL_STACK_TRACE_PC_BP(pc, bp)                              \
+  BufferedStackTrace stack;                                              \
+  if (msan_inited) {                                                     \
+    stack.Unwind(pc, bp, nullptr, common_flags()->fast_unwind_on_fatal); \
+  }
 
 #define GET_FATAL_STACK_TRACE_HERE \
   GET_FATAL_STACK_TRACE_PC_BP(StackTrace::GetCurrentPc(), GET_CURRENT_FRAME())
diff --git a/lib/sanitizer_common/sanitizer_common_interceptors.inc b/lib/sanitizer_common/sanitizer_common_interceptors.inc
index fe992bf..7ea896e 100644
--- a/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -3070,13 +3070,14 @@
     COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd);
   }
   int res = REAL(sendmmsg)(fd, msgvec, vlen, flags);
-  if (res >= 0 && msgvec)
+  if (res >= 0 && msgvec) {
     for (int i = 0; i < res; ++i) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &msgvec[i].msg_len,
                                      sizeof(msgvec[i].msg_len));
       if (common_flags()->intercept_send)
         read_msghdr(ctx, &msgvec[i].msg_hdr, msgvec[i].msg_len);
     }
+  }
   return res;
 }
 #define INIT_SENDMMSG COMMON_INTERCEPT_FUNCTION(sendmmsg);
@@ -3207,20 +3208,21 @@
   __sanitizer_iovec local_iovec;
 
   if (data) {
-    if (request == ptrace_setregs)
+    if (request == ptrace_setregs) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_regs_struct_sz);
-    else if (request == ptrace_setfpregs)
+    } else if (request == ptrace_setfpregs) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_fpregs_struct_sz);
-    else if (request == ptrace_setfpxregs)
+    } else if (request == ptrace_setfpxregs) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_fpxregs_struct_sz);
-    else if (request == ptrace_setvfpregs)
+    } else if (request == ptrace_setvfpregs) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_vfpregs_struct_sz);
-    else if (request == ptrace_setsiginfo)
+    } else if (request == ptrace_setsiginfo) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, siginfo_t_sz);
+
     // Some kernel might zero the iovec::iov_base in case of invalid
     // write access.  In this case copy the invalid address for further
     // inspection.
-    else if (request == ptrace_setregset || request == ptrace_getregset) {
+    } else if (request == ptrace_setregset || request == ptrace_getregset) {
       __sanitizer_iovec *iovec = (__sanitizer_iovec*)data;
       COMMON_INTERCEPTOR_READ_RANGE(ctx, iovec, sizeof(*iovec));
       local_iovec = *iovec;
@@ -3237,19 +3239,19 @@
   if (!res && data) {
     // Note that PEEK* requests assign different meaning to the return value.
     // This function does not handle them (nor does it need to).
-    if (request == ptrace_getregs)
+    if (request == ptrace_getregs) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_regs_struct_sz);
-    else if (request == ptrace_getfpregs)
+    } else if (request == ptrace_getfpregs) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_fpregs_struct_sz);
-    else if (request == ptrace_getfpxregs)
+    } else if (request == ptrace_getfpxregs) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_fpxregs_struct_sz);
-    else if (request == ptrace_getvfpregs)
+    } else if (request == ptrace_getvfpregs) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_vfpregs_struct_sz);
-    else if (request == ptrace_getsiginfo)
+    } else if (request == ptrace_getsiginfo) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, siginfo_t_sz);
-    else if (request == ptrace_geteventmsg)
+    } else if (request == ptrace_geteventmsg) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, sizeof(unsigned long));
-    else if (request == ptrace_getregset) {
+    } else if (request == ptrace_getregset) {
       __sanitizer_iovec *iovec = (__sanitizer_iovec*)data;
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, iovec, sizeof(*iovec));
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, local_iovec.iov_base,
@@ -7842,10 +7844,11 @@
     if (iov)
       COMMON_INTERCEPTOR_WRITE_RANGE(
           ctx, iov->iov_base, Min(iov_len,  iov->iov_len));
-  } else if (operation == modctl_exists)
+  } else if (operation == modctl_exists) {
     ret = REAL(modctl)(operation, argp);
-  else
+  } else {
     ret = REAL(modctl)(operation, argp);
+  }
 
   return ret;
 }
diff --git a/lib/sanitizer_common/sanitizer_flag_parser.cpp b/lib/sanitizer_common/sanitizer_flag_parser.cpp
index 4831814..1e2bc66 100644
--- a/lib/sanitizer_common/sanitizer_flag_parser.cpp
+++ b/lib/sanitizer_common/sanitizer_flag_parser.cpp
@@ -83,8 +83,9 @@
       Printf("%s: ERROR: expected '=' in %s\n", SanitizerToolName,
              env_option_name);
       Die();
-    } else
+    } else {
       fatal_error("expected '='");
+    }
   }
   char *name = ll_strndup(buf_ + name_start, pos_ - name_start);
 
diff --git a/lib/sanitizer_common/sanitizer_flag_parser.h b/lib/sanitizer_common/sanitizer_flag_parser.h
index b68e29c..c24ad25 100644
--- a/lib/sanitizer_common/sanitizer_flag_parser.h
+++ b/lib/sanitizer_common/sanitizer_flag_parser.h
@@ -24,7 +24,7 @@
   virtual bool Parse(const char *value) { return false; }
 
  protected:
-  ~FlagHandlerBase() {};
+  ~FlagHandlerBase() {}
 };
 
 template <typename T>
diff --git a/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc b/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
index 1ec7382..03ef7c1 100644
--- a/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
+++ b/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
@@ -1404,7 +1404,7 @@
   _(SNDCTL_DSP_SKIP, NONE, 0);
   _(SNDCTL_DSP_SILENCE, NONE, 0);
 #undef _
-}
+}  // NOLINT
 
 static bool ioctl_initialized = false;
 
diff --git a/lib/sanitizer_common/sanitizer_libc.cpp b/lib/sanitizer_common/sanitizer_libc.cpp
index 5c9d3a8..4bc04b4 100644
--- a/lib/sanitizer_common/sanitizer_libc.cpp
+++ b/lib/sanitizer_common/sanitizer_libc.cpp
@@ -63,10 +63,11 @@
     for (i = 0; i < signed_n; ++i)
       d[i] = s[i];
   } else {
-    if (d > s && signed_n > 0)
-      for (i = signed_n - 1; i >= 0 ; --i) {
+    if (d > s && signed_n > 0) {
+      for (i = signed_n - 1; i >= 0; --i) {
         d[i] = s[i];
       }
+    }
   }
   return dest;
 }
@@ -270,9 +271,9 @@
   for (; aligned_beg < aligned_end; aligned_beg++)
     all |= *aligned_beg;
   // Epilogue.
-  if ((char*)aligned_end >= beg)
-    for (const char *mem = (char*)aligned_end; mem < end; mem++)
-      all |= *mem;
+  if ((char *)aligned_end >= beg) {
+    for (const char *mem = (char *)aligned_end; mem < end; mem++) all |= *mem;
+  }
   return all == 0;
 }
 
diff --git a/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp b/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
index b520dc8..651d505 100644
--- a/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+++ b/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
@@ -223,10 +223,11 @@
       case ThreadLister::Ok:
         break;
     }
-    for (tid_t tid : threads)
+    for (tid_t tid : threads) {
       if (SuspendThread(tid))
         retry = true;
-  };
+    }
+  }
   return suspended_threads_list_.ThreadCount();
 }
 
diff --git a/lib/sanitizer_common/sanitizer_symbolizer_report.cpp b/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
index a8b449b..d6699f3 100644
--- a/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
+++ b/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
@@ -106,8 +106,9 @@
   if (StackTrace::WillUseFastUnwind(fast)) {
     GetThreadStackTopAndBottom(false, &top, &bottom);
     stack->Unwind(kStackTraceMax, pc, bp, nullptr, top, bottom, true);
-  } else
+  } else {
     stack->Unwind(kStackTraceMax, pc, 0, nullptr, 0, 0, false);
+  }
 
   Printf("%s", d.Warning());
   Report("WARNING: %s: writable-executable page usage\n", SanitizerToolName);
diff --git a/lib/sanitizer_common/scripts/check_lint.sh b/lib/sanitizer_common/scripts/check_lint.sh
index ecd61c0..8c8fc33 100755
--- a/lib/sanitizer_common/scripts/check_lint.sh
+++ b/lib/sanitizer_common/scripts/check_lint.sh
@@ -17,15 +17,15 @@
 # Filters
 # TODO: remove some of these filters
 COMMON_LINT_FILTER=-build/include,-build/header_guard,-legal/copyright,-whitespace/comments,-readability/casting,\
--build/namespaces,-readability/braces,-build/c++11,-runtime/int
+-build/namespaces,-build/c++11,-runtime/int
 
 COMMON_LIT_TEST_LINT_FILTER=-whitespace/indent,-whitespace/line_length,-runtime/arrays
 
 ASAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
-ASAN_TEST_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/sizeof,-runtime/printf,-runtime/threadsafe_fn
+ASAN_TEST_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/printf,-runtime/threadsafe_fn
 ASAN_LIT_TEST_LINT_FILTER=${ASAN_TEST_LINT_FILTER},${COMMON_LIT_TEST_LINT_FILTER}
 
-TSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
+TSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-readability/braces
 TSAN_TEST_LINT_FILTER=${TSAN_RTL_LINT_FILTER},-runtime/threadsafe_fn
 TSAN_LIT_TEST_LINT_FILTER=${TSAN_TEST_LINT_FILTER},${COMMON_LIT_TEST_LINT_FILTER}
 
@@ -34,10 +34,10 @@
 LSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
 LSAN_LIT_TEST_LINT_FILTER=${LSAN_RTL_LINT_FILTER},${COMMON_LIT_TEST_LINT_FILTER}
 
-DFSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/printf,-runtime/references,-readability/function
+DFSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
 SCUDO_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
 
-COMMON_RTL_INC_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/sizeof,-runtime/printf,-readability/fn_size
+COMMON_RTL_INC_LINT_FILTER=${COMMON_LINT_FILTER}
 
 SANITIZER_INCLUDES_LINT_FILTER=${COMMON_LINT_FILTER}
 
diff --git a/lib/sanitizer_common/tests/sanitizer_printf_test.cpp b/lib/sanitizer_common/tests/sanitizer_printf_test.cpp
index d213d10..956ed65 100644
--- a/lib/sanitizer_common/tests/sanitizer_printf_test.cpp
+++ b/lib/sanitizer_common/tests/sanitizer_printf_test.cpp
@@ -33,7 +33,7 @@
 
 TEST(Printf, OverflowStr) {
   char buf[] = "123456789";
-  uptr len = internal_snprintf(buf, 4, "%s", "abcdef");
+  uptr len = internal_snprintf(buf, 4, "%s", "abcdef");  // NOLINT
   EXPECT_EQ(len, (uptr)6);
   EXPECT_STREQ("abc", buf);
   EXPECT_EQ(buf[3], 0);
@@ -47,7 +47,7 @@
 
 TEST(Printf, OverflowInt) {
   char buf[] = "123456789";
-  internal_snprintf(buf, 4, "%d", -123456789);
+  internal_snprintf(buf, 4, "%d", -123456789);  // NOLINT
   EXPECT_STREQ("-12", buf);
   EXPECT_EQ(buf[3], 0);
   EXPECT_EQ(buf[4], '5');
@@ -66,7 +66,7 @@
   } else {
     val = (uptr)0x123456789ULL;
   }
-  internal_snprintf(buf, 4, "a%zx", val);
+  internal_snprintf(buf, 4, "a%zx", val);  // NOLINT
   EXPECT_STREQ("a12", buf);
   EXPECT_EQ(buf[3], 0);
   EXPECT_EQ(buf[4], '5');
@@ -85,7 +85,7 @@
   } else {
     p = (void*)0x123456789ULL;
   }
-  internal_snprintf(buf, 4, "%p", p);
+  internal_snprintf(buf, 4, "%p", p);  // NOLINT
   EXPECT_STREQ("0x0", buf);
   EXPECT_EQ(buf[3], 0);
   EXPECT_EQ(buf[4], '5');
@@ -149,7 +149,7 @@
   EXPECT_STREQ("12345 ", buf);
   // Check that width does not overflow the smaller buffer, although
   // 10 chars is requested, it stops at the buffer size, 8.
-  len = internal_snprintf(buf, 8, "%-10s", "12345");
+  len = internal_snprintf(buf, 8, "%-10s", "12345");  // NOLINT
   EXPECT_EQ(10U, len);  // The required size reported.
   EXPECT_STREQ("12345  ", buf);
 }
diff --git a/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp b/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp
index 6fce03a..50a6ce9 100644
--- a/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp
+++ b/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp
@@ -18,7 +18,7 @@
 
 static bool MyMatch(const char *templ, const char *func) {
   char tmp[1024];
-  strcpy(tmp, templ);
+  snprintf(tmp, sizeof(tmp), "%s", templ);
   return TemplateMatch(tmp, func);
 }
 
diff --git a/test/asan/TestCases/scariness_score_test.cpp b/test/asan/TestCases/scariness_score_test.cpp
index fb174eb..b601225 100644
--- a/test/asan/TestCases/scariness_score_test.cpp
+++ b/test/asan/TestCases/scariness_score_test.cpp
@@ -155,9 +155,9 @@
     case 10: StackBufferOverflow<char>(0, Write); break;
     case 11: StackBufferOverflow<int64_t>(0, Read); break;
     case 12:
-      if (scale <= 3)
+      if (scale <= 3) {
         StackBufferOverflow<int>(16, Write);
-      else {
+      } else {
         // At large shadow granularity, there is not enough redzone
         // between stack elements to detect far-from-bounds.  Pretend
         // that this test passes.