aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2003-08-17 05:46:52 +0000
committernyamatongwe <devnull@localhost>2003-08-17 05:46:52 +0000
commit9cef096b83c6439b9d468a76d74c088f29602e46 (patch)
treea318019f89627618ce420a526424e2506f5f6ce8 /src
parentf704830636e29648e5ce767bc190680b3d7c9dc6 (diff)
downloadscintilla-mirror-9cef096b83c6439b9d468a76d74c088f29602e46.tar.gz
Added assertion to prevent retrieving text beyond the end of the document.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 8544ee756..1376787fa 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -5311,6 +5311,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
int cpMax = tr->chrg.cpMax;
if (cpMax == -1)
cpMax = pdoc->Length();
+ PLATFORM_ASSERT(cpMax <= pdoc->Length());
int len = cpMax - tr->chrg.cpMin; // No -1 as cpMin and cpMax are referring to inter character positions
pdoc->GetCharRange(tr->lpstrText, tr->chrg.cpMin, len);
// Spec says copied text is terminated with a NUL