diff options
-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 |