From ef75a00a35ddc6dbd8593f3fb94e8fbe048ff410 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 19 Oct 2015 21:52:08 +1100 Subject: Bug [#1768]. Report error when negative length passed to SCI_SETSTYLING. --- doc/ScintillaHistory.html | 4 ++++ src/Editor.cxx | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 87f79f755..35592a94c 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -530,6 +530,10 @@ Optimise marker redrawing by only drawing affected lines when markers shown in the text.
  • + Report error (SC_STATUS_FAILURE) when negative length passed to SCI_SETSTYLING. + Bug #1768. +
  • +
  • When SC_MARK_UNDERLINE if not assigned to a margin, stop drawing the whole line.
  • diff --git a/src/Editor.cxx b/src/Editor.cxx index 8a3a367db..6141b0628 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -6267,7 +6267,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { break; case SCI_SETSTYLING: - pdoc->SetStyleFor(static_cast(wParam), static_cast(lParam)); + if (static_cast(wParam) < 0) + errorStatus = SC_STATUS_FAILURE; + else + pdoc->SetStyleFor(static_cast(wParam), static_cast(lParam)); break; case SCI_SETSTYLINGEX: // Specify a complete styling buffer -- cgit v1.2.3