From ae1745d37550de264b600b08c13242513116b8ac Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Thu, 16 Apr 2020 15:07:28 -0700 Subject: [PATCH] Fix foritfy test for clang update. When doing checkbuild for make_fortify_compile_test.mk: bionic/tests/clang_fortify_tests.cpp error: 'error' diagnostics seen but not expected: Line 171: 'mempcpy' will always overflow; destination buffer has size 8, but size argument is 9 1 error generated. Bug: 149839606 Test: run checkbuild. Change-Id: I97371600f6183b5cee8c2a6b976f5bf33e1f781d --- tests/clang_fortify_tests.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/clang_fortify_tests.cpp b/tests/clang_fortify_tests.cpp index 018880fd3..715f9c81c 100644 --- a/tests/clang_fortify_tests.cpp +++ b/tests/clang_fortify_tests.cpp @@ -167,6 +167,8 @@ FORTIFY_TEST(string) { EXPECT_FORTIFY_DEATH(memcpy(small_buffer, large_buffer, sizeof(large_buffer))); // expected-error@+1{{will always overflow}} EXPECT_FORTIFY_DEATH(memmove(small_buffer, large_buffer, sizeof(large_buffer))); + // FIXME(gbiv): look into removing mempcpy's diagnose_if bits once the b/149839606 roll sticks. + // expected-error@+2{{will always overflow}} // expected-error@+1{{size bigger than buffer}} EXPECT_FORTIFY_DEATH(mempcpy(small_buffer, large_buffer, sizeof(large_buffer))); // expected-error@+1{{will always overflow}}