From a38814c0038fb4bf756547a3f50d125da0066737 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Mon, 26 Sep 2016 12:46:19 +0300 Subject: [PATCH] re PR libstdc++/77717 (testsuite/21_strings/basic_string_view/operations/compare/char/1.cc makes undefined memcmp call) PR libstdc++/77717 * testsuite/21_strings/basic_string_view/operations/compare/char/1.cc: Fix an out-of-bounds access. From-SVN: r240486 --- libstdc++-v3/ChangeLog | 6 ++++++ .../basic_string_view/operations/compare/char/1.cc | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 230f764fd6f..e3e26d1440c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2016-09-26 Ville Voutilainen + + PR libstdc++/77717 + * testsuite/21_strings/basic_string_view/operations/compare/char/1.cc: + Fix an out-of-bounds access. + 2016-09-26 Marek Polacek PR c/7652 diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc index 77188b3eba1..28e2514d016 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc @@ -82,8 +82,8 @@ test01() test_value(strncmp(str_1.data(), str_0.data(), 6), z); test_value(strncmp(str_1.data(), str_0.data(), 14), lt); test_value(memcmp(str_1.data(), str_0.data(), 6), z); - test_value(memcmp(str_1.data(), str_0.data(), 14), lt); - test_value(memcmp("costa marbella", "costa rica", 14), lt); + test_value(memcmp(str_1.data(), str_0.data(), 10), lt); + test_value(memcmp("costa marbella", "costa rica", 10), lt); // int compare(const basic_string_view& str) const; test_value(str_0.compare(str_1), gt); //because r>m -- 2.30.2