From a2aa56d2cbf9a6c12e834adce3c5154b82292f7f Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 4 Jun 2012 12:49:48 +1000 Subject: Validate length of deletion: negative values caused crashes. --- src/Document.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Document.cxx b/src/Document.cxx index 82b9e070b..73dfda547 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -751,7 +751,7 @@ void Document::CheckReadOnly() { // SetStyleAt does not change the persistent state of a document bool Document::DeleteChars(int pos, int len) { - if (len == 0) + if (len <= 0) return false; if ((pos + len) > Length()) return false; -- cgit v1.2.3