aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-03-16 10:16:39 +1100
committerNeil <nyamatongwe@gmail.com>2017-03-16 10:16:39 +1100
commitc4525063b04596175d25177583ce1655791cbc0f (patch)
tree40524c75918fc359896aad9f4b5dee05d59ddd27 /src
parent4b2cbd11ee5c51e74345ddcf33fdf2bf7f77e8a5 (diff)
downloadscintilla-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 'src')
-rw-r--r--src/SparseVector.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/SparseVector.h b/src/SparseVector.h
index f96b36b8b..20fa56cca 100644
--- a/src/SparseVector.h
+++ b/src/SparseVector.h
@@ -100,7 +100,8 @@ public:
if (partition == 0) {
// Inserting at start of document so ensure 0
if (valueCurrent != T()) {
- ClearValue(0);
+ // Since valueCurrent is needed again, should not ClearValue
+ values->SetValueAt(0, T());
starts->InsertPartition(1, 0);
values->InsertValue(1, 1, valueCurrent);
starts->InsertText(0, insertLength);