diff --git a/include/etl/basic_string.h b/include/etl/basic_string.h index e3effdf0..10c0afc8 100644 --- a/include/etl/basic_string.h +++ b/include/etl/basic_string.h @@ -437,6 +437,7 @@ namespace etl current_size = new_size; p_buffer[new_size] = 0; + cleanup(); } //********************************************************************* diff --git a/include/etl/version.h b/include/etl/version.h index da98a129..f338b0c8 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 14 #define ETL_VERSION_MINOR 23 -#define ETL_VERSION_PATCH 0 +#define ETL_VERSION_PATCH 1 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) ETL_STRINGIFY(ETL_VERSION_MINOR) ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_WIDE_STRING(ETL_CONCAT(ETL_CONCAT(ETL_VERSION_MAJOR, ETL_VERSION_MINOR), ETL_VERSION_PATCH)) diff --git a/support/Release notes.txt b/support/Release notes.txt index 42f12388..b01728aa 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +14.23.1 +Added missing 'cleanup' to string's resize() method. + =============================================================================== 14.23.0 Added an optional secure mode to strings so that unused space will be cleared to zero diff --git a/test/test_string_char.cpp b/test/test_string_char.cpp index 9d5644fc..b30d30c1 100644 --- a/test/test_string_char.cpp +++ b/test/test_string_char.cpp @@ -3689,6 +3689,20 @@ namespace CHECK(std::find_if(text.end(), pe, [](Text::value_type x) { return x != 0; }) == pe); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_secure_after_resize_down) + { + Text text; + text.set_secure(); + text.assign(STR("ABCDEF")); + + Text::pointer pe = text.end(); + + text.resize(text.size() - 3U); + + CHECK(std::find_if(text.end(), pe, [](Text::value_type x) { return x != 0; }) == pe); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_erase) {