diff options
author | Yabin Cui <yabinc@google.com> | 2020-04-16 15:07:28 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2020-04-30 14:12:22 -0700 |
commit | 073fdd907ab6776f040ba60b34f9e77b3995f849 (patch) | |
tree | df5b4cf68c2c6534658d562f96eb2274422ef3e8 | |
parent | 524510bc5c9fedec1c97925d6bb27ebee6bf2e10 (diff) | |
download | bionic-073fdd907ab6776f040ba60b34f9e77b3995f849.tar.gz |
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
(cherry picked from commit ae1745d37550de264b600b08c13242513116b8ac)
-rw-r--r-- | tests/clang_fortify_tests.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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}} |