summaryrefslogtreecommitdiffstats
path: root/scintilla/src/CellBuffer.cxx
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2015-03-07 12:05:41 +0200
committerXhmikosR <xhmikosr@gmail.com>2015-03-09 08:44:41 +0200
commit4ac30880a3dd4769bb5f1287e90aa0db9ede212c (patch)
tree7d237930bb68fc714efc6945eae98ae7df3f6dbe /scintilla/src/CellBuffer.cxx
parent12949f79fc6487022b0ffea17dd9eadd43d5b1c0 (diff)
downloadnotepad2-mod-4ac30880a3dd4769bb5f1287e90aa0db9ede212c.zip
notepad2-mod-4ac30880a3dd4769bb5f1287e90aa0db9ede212c.tar.gz
notepad2-mod-4ac30880a3dd4769bb5f1287e90aa0db9ede212c.tar.bz2
Update Scintilla to v3.5.4.4.2.25.945
Diffstat (limited to 'scintilla/src/CellBuffer.cxx')
-rw-r--r--scintilla/src/CellBuffer.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/scintilla/src/CellBuffer.cxx b/scintilla/src/CellBuffer.cxx
index f69ab62..4203f0a 100644
--- a/scintilla/src/CellBuffer.cxx
+++ b/scintilla/src/CellBuffer.cxx
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdarg.h>
+#include <stdexcept>
#include <algorithm>
#include "Platform.h"
@@ -786,6 +787,10 @@ const Action &CellBuffer::GetUndoStep() const {
void CellBuffer::PerformUndoStep() {
const Action &actionStep = uh.GetUndoStep();
if (actionStep.at == insertAction) {
+ if (substance.Length() < actionStep.lenData) {
+ throw std::runtime_error(
+ "CellBuffer::PerformUndoStep: deletion must be less than document length.");
+ }
BasicDeleteChars(actionStep.position, actionStep.lenData);
} else if (actionStep.at == removeAction) {
BasicInsertString(actionStep.position, actionStep.data, actionStep.lenData);