diff options
author | nyamatongwe <unknown> | 2003-08-17 05:46:52 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2003-08-17 05:46:52 +0000 |
commit | f0b0cd4c31e2195d6647105bcee73191ab3d4b4b (patch) | |
tree | a318019f89627618ce420a526424e2506f5f6ce8 /src | |
parent | b0b088e8a8f2e09e12620e29839bb8ba5bd1e52c (diff) | |
download | scintilla-mirror-f0b0cd4c31e2195d6647105bcee73191ab3d4b4b.tar.gz |
Added assertion to prevent retrieving text beyond the end of the document.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 1 |
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 |