diff options
Diffstat (limited to 'tests/fortify1_test.cpp')
-rw-r--r-- | tests/fortify1_test.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/fortify1_test.cpp b/tests/fortify1_test.cpp index be59a1824..b8751bbef 100644 --- a/tests/fortify1_test.cpp +++ b/tests/fortify1_test.cpp @@ -80,6 +80,16 @@ TEST(Fortify1_DeathTest, strrchr_fortified) { memcpy(buf, "0123456789", sizeof(buf)); ASSERT_EXIT(printf("%s", strrchr(buf, 'a')), testing::KilledBySignal(SIGABRT), ""); } + +TEST(Fortify1_DeathTest, strlcpy_fortified) { + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + char bufa[15]; + char bufb[10]; + strcpy(bufa, "01234567890123"); + size_t n = strlen(bufa); + ASSERT_EXIT(strlcpy(bufb, bufa, n), testing::KilledBySignal(SIGABRT), ""); +} + #endif TEST(Fortify1_DeathTest, sprintf_fortified) { |