diff options
author | Neil <nyamatongwe@gmail.com> | 2017-03-16 10:16:39 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-03-16 10:16:39 +1100 |
commit | c4525063b04596175d25177583ce1655791cbc0f (patch) | |
tree | 40524c75918fc359896aad9f4b5dee05d59ddd27 /test/unit/testSparseVector.cxx | |
parent | 4b2cbd11ee5c51e74345ddcf33fdf2bf7f77e8a5 (diff) | |
download | scintilla-mirror-c4525063b04596175d25177583ce1655791cbc0f.tar.gz |
Fix use-after-free in fold tags when top line folded then new top line inserted.
In SparseVector, string inserted at start then NULL inserted at start.
Diffstat (limited to 'test/unit/testSparseVector.cxx')
-rw-r--r-- | test/unit/testSparseVector.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/testSparseVector.cxx b/test/unit/testSparseVector.cxx index 11960163e..e0db7d094 100644 --- a/test/unit/testSparseVector.cxx +++ b/test/unit/testSparseVector.cxx @@ -89,6 +89,18 @@ TEST_CASE("SparseVector") { st.Check(); } + SECTION("InsertStringAtStartThenInsertSpaceAtStart") { + REQUIRE(1 == st.Elements()); + st.InsertSpace(0, 5); + st.SetValueAt(0, "3"); + REQUIRE(1 == st.Elements()); + REQUIRE("3----" == Representation(st)); + st.InsertSpace(0, 1); + REQUIRE(2 == st.Elements()); + REQUIRE("-3----" == Representation(st)); + st.Check(); + } + SECTION("InsertAndDeleteAtEnd") { REQUIRE(1 == st.Elements()); st.InsertSpace(0, 5); |