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. --- src/Editor.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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